General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only