Have you set the number of decimals to round to on the currency code? (I
think you want 0.0001 and not the default 0.0100) as I guess this is applied
inside the priceDisc.price() ....

  -----Original Message-----
  From: Jens Strandberg [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 30, 2004 2:09 AM
  To: [EMAIL PROTECTED] Com (E-mail)
  Subject: [development-axapta] Decimals in Axapta


  Hello there,

  I am having some difficulties with decimals in Axapta.

  It seems that Axapta will always use 2 decimals - everywhere...

  A simple job like "(100 * 100.1)" will return a value of 10010.00; i.e. 2
  decimals. Similarly, if you multiply 2 4-decimal values, Axapta will also
  return only 2 decimals.

  Another example:
  Take a look at the initFromPriceDisc method of the table SalesLine:

  void initFromPriceDisc(PriceDisc priceDisc)
  {
      ;
      this.salesPrice         = priceDisc.price();
      this.priceUnit          = priceDisc.priceUnit();
      this.salesMarkup        = priceDisc.markup();
      this.confirmedDlv       = this.salesTable().deliveryDate;

      if (priceDisc.deliveryDays())
          this.confirmedDlv = max(systemdateGet() +
priceDisc.deliveryDays(),
  this.confirmedDlv);
  }

  this.salesPrice will always return 2 decimals, even though I have modified
  the EDT (actually created a new one that extends the original one) to hold
4
  decimals.

  If I - for testing purposes - change to "this.SalesPrice         =
4.5678;",
  this will return all 4 decimals.

  All I want is to have the unit prices in SalesLine and PurchLine reflect
the
  relevant price in PriceDiscTable. Please note that all fields (SalesPrice,
  PurchPrice etc.) have been setup to accept 4 decimals, but something goes
  wrong in the above method.

  What am I missing here... ?

  Thanks in advance.

  Best Regards,
  Jens

  Ax_30_SP1



        Yahoo! Groups Sponsor
              ADVERTISEMENT





----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/development-axapta/

    b.. To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to