Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Variable Calculation Problem

edited August 2004 in General
Hello,

Delphi 7, Reportbuilder 7.04

When calculating a variable on the traversal the following statement works.

Value := MDSMasterDetail2.DataSet.FieldByName('InventoryVOH').AsCurrency /
MDSMasterDetail2.DataSet.FieldByName('InventoryQOH').AsCurrency

However, when using the Delphi RoundTo function the value is set to zero.
Why?

Value :=
RoundTo(MDSMasterDetail2.DataSet.FieldByName('InventoryVOH').AsCurrency /
MDSMasterDetail2.DataSet.FieldByName('InventoryQOH').AsCurrency,4)

Thanks in advance

Comments

  • edited August 2004
    Hi Stan,

    I believe the reason you are getting a zero is that your precision is set to
    round to the nearest ten thousands place. If you make it a -4, it will
    round to the right of the decimal place (or the ten thousandths place).

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2004
    Sorry,

    You are correct, all is working well.

    Thank you


This discussion has been closed.