Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The simplest way to convert a number?
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00575272
Message ID:
00575276
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
lnNum = 4567
? Round(lnNum, -(Len(Transform(lnNum))-1))
>Hi everyone,
>
>I'd like to convert numbers to the following:

>5->5 ROUND(...,0)
>52->50 ROUND(...,-1)
>333->300 ROUND(...,-2)
>4567->5000 ROUND(...,-3)
>1234567->1000000, e.g. to the round number.
>
>What would be the simplest algorithm for this?
>
>Thanks in advance.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform