Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Numbers into Strings
Message
From
25/01/2001 12:07:38
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
 
 
To
25/01/2001 11:47:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00468512
Message ID:
00468552
Views:
16
I have used the concept before, but there are some issues with large numbers that do crop up!

What exactly are you trying to achieve? ( that is, if the start number is 1/3, you will have an infinite # of decimal places, ! )

I don't see any problems if you can control the extreme cases , so a smarter udf might be

n = int(orig_number)
decimals = orig_number - n

big_dec = decimals * 10^16

DO while int(big_dec/10)=big_dec/10 && if a factor of 10
big_dec=big_dec/10
enddo

str_decimals=str(big_dec)

now you can decide how many places of len(str_decimals) to show
Previous
Reply
Map
View

Click here to load this message in the networking platform