Formatting large numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a Text Box on a Form where the user can enter a ver large # (1
Trillion and with 6 decimal places). But I am having trouble having it stay
Formatted correctly when the user moves to another field. It keeps rounding
to 2 decimal places.

So for example if the user puts 1222333444555.123456 Access then makes it
1,222,333,444,555.120000.
I want it to Format to 1,222,333,444,555.123456

Or if

I have set the Input Maske to 9999999999999.999999
I have set the Deciaml Places Property to 6
and I have played around with many different Formats, like:
#,##0.000000
#,##0
#,###.######

I even tried in the AfterUpdate Event using the CDEC function to convert it
to Decimal but then leaves it in Scientific Notaion.

Can someone please help me so that again it Formats to
1,222,333,444,555.123456 ?

Also if I use a small er # like up to millions it works fine, I just run
into this problem when I use very large #s.

Any help would be greatly appreciated.

Thank you,
Jeff
 
Jeff said:
Hello,

I have a Text Box on a Form where the user can enter a ver large # (1
Trillion and with 6 decimal places). But I am having trouble having it stay
Formatted correctly when the user moves to another field. It keeps rounding
to 2 decimal places.

So for example if the user puts 1222333444555.123456 Access then makes it
1,222,333,444,555.120000.
I want it to Format to 1,222,333,444,555.123456

Or if

I have set the Input Maske to 9999999999999.999999
I have set the Deciaml Places Property to 6
and I have played around with many different Formats, like:
#,##0.000000
#,##0
#,###.######

I even tried in the AfterUpdate Event using the CDEC function to convert it
to Decimal but then leaves it in Scientific Notaion.

Can someone please help me so that again it Formats to
1,222,333,444,555.123456 ?

Also if I use a small er # like up to millions it works fine, I just run
into this problem when I use very large #s.

Any help would be greatly appreciated.

Thank you,
Jeff

For a text box choosing
Format: Standard ; Decimal Places: 6
should work

If the text box is bound to a database field, you have other problems.
Single only stores about 6 significant digits, double stores about 15 or so.
Currency will only keep 4 digits to the right of the decimal point, and
Decimal is integer only.
 
Hello,

No that does not work, it does the rounding like I mentioned.

Do you have any other ideas ? Any one else ?

Thank you,
Jeff
 
OK, it works up to 999 million.
Greater 1 trillion it rounds to 5 decimal places.

Looks like you'll have to put something in the AfterUpdate event then do the
formatting yourself in VB code and output a string. Should not be too
difficult when you can build on top of the intrinsic Format function, and
sub-string functions. Something along the lines of splitting the input to
"left of decimal" and "right of decimal", detect any carry-over, then join
the pieces back as a string.
 
Hi Jeff

You have reached the limit of precision of the Double data type
(approximately 14-15 significant figures), so the result is being rounded.

Assuming these numbers are stored in a table, change the data type of the
field to Decimal, with a scale of 6 and a precision of at least 19 (more in
you want numbers greater that 10^13).
 
Back
Top