TheWaterboy
Lifetime Supporting Member + Moderator
I am writing a routine to convert and condition a raw value into a buffered value with a specified number of decimal places.
The formula I use for 2 decimal places is REAL=((TRN(value x 100) * .01)
Works well enough but I would like to make the multiplier terms operator configurable, i.e. i.e. 2 = 2 decimal places (2=100 and .01, 3=1000 and .001 etc).
How, without using a lookup table or case statement, can I turn a 2 into 100? I can invert that (1/x) to get the other term but the first one eludes me.
The formula I use for 2 decimal places is REAL=((TRN(value x 100) * .01)
Works well enough but I would like to make the multiplier terms operator configurable, i.e. i.e. 2 = 2 decimal places (2=100 and .01, 3=1000 and .001 etc).
How, without using a lookup table or case statement, can I turn a 2 into 100? I can invert that (1/x) to get the other term but the first one eludes me.