Decimals Getting Dropped From Output Follow

0
Avatar
Legacy Poster

I am trying to do a simple calculation on a field, but the output is dropping the resulting decimal places. Specifically, the width field would have fractions like 12.61, 5.718, etc. Can someone help? My multi-line code looks like this:

 

Output = 0

UoM = 12
 
If dataUoM = "Feet"    Then 
UoM = 12
ELSE UoM = 36
END If
 
Output = (1 * Format.NamedSubStrings("dataWidth").Value * Format.NamedSubStrings("dataLength").Value * UoM) \ 1000
 
Value = Output

2 comments

0
Avatar
Legacy Poster
Comment actions Permalink

Try

/ 1000

...instead of \ 1000 (at the end). A division with \ will discard any fractional value (afaik...).

0
Avatar
Legacy Poster
Comment actions Permalink

Wow, what a simple fix. Worked! Thank you so much for your help.

Please sign in to leave a comment.