Site Search:
Sign in | Join | Help

Problem with decimal places

Last post 08-13-2007 2:59 PM by Steve Gray. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-13-2007 2:13 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.

    • 201.234.203.139
  • 08-13-2007 2:59 PM In reply to

    Re: Problem with decimal places

    Answer

    Dynamics has setups that specify the decimal places for quantities and amounts in SOP and POP. If you send in an number that exceeds that, you'll get a validation error. GP will not round for you. You'll have to do that.

    Steve Gray, MCDBA
    Technical Editor
    steve@VSToolsForum.com
    • 216.77.101.2
Page 1 of 1 (2 items)