Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totext Ouput causes Tonumber Error

Status
Not open for further replies.

asmetana

MIS
May 7, 2001
15
US
Output from Totext of a large number (>10^17) causes Tonumber to error with "String is non-numeric".

The following made up sample illustrates the error:
tonumber(totext(1.*10^17))

This error happens because totext returns scientific notation for large numbers and tonumber doesn't know how do deal with scientific notation.

I tried supplying a large format string like
totext(big_number,"#####################") but it still returns scientific notation.

Is there anyway to force totext NOT to return scientific notation?

Along the same lines, if your formula returns a large number, your report field is displayed in scientific notation. For example the formula:

10000000000000000. produces 10,000,000,000,000,000
but
100000000000000000. produces 1e+017

in the report field.
Is there anyway to control this format such that scientific notation is produced for smaller numbers or not produced for large numbers?

Thanks
 
It's too long for poor widdle Crystal to handle...

Note that:

totext(1*(10^17))

returns the Scientific Notation of:

1e+017

Check this thread:


Want to see something even more annoying, try this formulas result:

totext(1*11111111111111111,0,"")

it returns:

11111111111111100

Serves to prove that Math is hard ;)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top