Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transform vs round
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01024029
Message ID:
01024051
Views:
23
>Is there a way to stop the transform function to round to what Set Decimals is set to?
>
>Ex
>
>SET DECIMALS TO 2
>? TRANSFORM(999.0288, '#####.###') && Prints 999.030
>SET DECIMALS TO 3
>? TRANSFORM(999.0288, '#####.###') && Prints 999.029
>
Chuck, here is a workaround:
n=SET("Decimals")
SET DECIMALS TO 4
? TRANSFORM(TRANSFORM(999.0288, '#####.#####'), '#####.###') && Prints 999.028
SET DECIMALS TO (m.n)
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Reply
Map
View

Click here to load this message in the networking platform