Thanks for the examples Erick and John.
format(123 , "###.###") = 123. (prints a decimal point)
So..... is the solution as John suggested?
Test for a fractional number and select the appropriate format.
It's hard to believe that RB does not have a more elegant solution.
Thanks for all the fast replies.
Barrie

On Jan 20, 2006, at 1:03 AM, E. Tejkowski wrote:


format(123.456 , "#.###") = 123.456 (prints 3 decimal values)
format(123.456 , "#.0000") = 123.4560 (zero gets inserted if no value is present for that position)
format(123.456 , "#") = 123 (no decimal points)

Another thing you could do is convert the decimal (double) to an integer. That will knock off the decimal places too, but maybe not the way you had hoped. You'll have to experiment for your needs..

dim i as integer
i = 123.456

hth,
Erick


On Jan 19, 2006, at 11:55 PM, Barrie Jones wrote:

John, many thanks. My numbers can be both decimal and integer so I use a format string "########.##" but integer numbers are displayed with a decimal point at the end. Do I have to manually remove the point? That seems a bit crude.
Barrie

On Jan 20, 2006, at 12:39 AM, John Kubie wrote:

use "format" instead of "str" to convert numbers to strings.

For example

     str(25^56)="2.441406e+8"

while

    format (25^6,"#")="244140625"

"#" is the format specifier. You'll have to learn how these work. Other than the format specifier, str and format are equivalent. Format is always better.

John Kubie


On Jan 19, 2006, at 11:36 PM, Barrie Jones wrote:

How do I prevent large numbers in an editfield defaulting to exponentials?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to