Variable Calculation Problem
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
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
This discussion has been closed.
Comments
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).
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
You are correct, all is working well.
Thank you