I'm making a report and I need precise decimal values. A number could have a value of 2 decimal places and a number could have a value of 10. If I set the decimal range to 10 places that column will always show 10 decimal places of mostly 0's. How do I ignore 0's in the value if they are present? For example I like the data to show like this:
123.24
98.234
1212.678432
instead of:
123.2400000000
98.2340000000
1212.6784320000
Do the following:
Paste the following code, and make sure to change {myproc;1.col1} to reflect your procedure/column:
stringVar number := ToText({myproc;1.col1}, 8);
while (right(number, 1) = "0") do
number := left(number, len(number) - 1);
len(number) - InStr(number, ".");
Important:
A simplest just try the code below at format filed->Number->Customize-> Decimals Code Part:
if CurrentFieldValue=Int(CurrentFieldValue) then
0
else
2
The number '2' is decimal place of yours and you can replace it by your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With