Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Something about handling digital place convertion
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00172476
Message ID:
00176065
Views:
34
Firstly, thanks for help. I copied your suggestion in my program, it works but still have a problem. The user will input the X in a text box of a grid. The text box width is 6. If the user inputted 10.99, the program will get the 99. But if I inputted 1.99, it will get 9. If I inputted 111.99, it will get 11.99. I don't understand why, how can I solve this problem?

>The only consistent way to make this work is to
>set the input variable as a character expression
>such as "10.1" so that there is no confusion between
>10.1 and 10.10 etc.
>
>So, try the following code.
>
>** X is your input expression
>X = "10.8"
>** Y is your numeric output expression
>Y = INT(VAL(X)) + VAL(RIGHT(X,RAT(X,".")+1))/16
>** Z is your character output expression with 2 decimals of precision
>Z = TRANSFORM(Y,"999.99")
>Therefore Y = 10.5
Power Wong
Every problem will have a solution, the only problem is that can you find it out.
Previous
Reply
Map
View

Click here to load this message in the networking platform