xap5xap 8/13/2007 2:13:57 PM

Problem with decimal places

I was using WebServices for Dynamics GP.

When i call the method CreatePurchaseOrder i'm having this error: Input number of decimal exceeds setup for currency decimal places.

This is the code that i wrote: 

MoneyAmount ma = new MoneyAmount();
                    ma.Currency = "USD";
                    ma.DecimalDigits = 2;
                    ma.Value = 12.66789;

purchaseOrderLine.UnitCost =ma ;

Do I have to round the number before pass to the object? 

Does GP have a method to round numbers?

i don't want to use the method Math.Round because I donĀ“t want to lose some decimals. Instead, I would like GP do it for me.

Version: Unknown or N/A
Section: Visual Studio Tools for Dynamics GP


Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3