There is a large number
a = 123456789012345678901234567.123456789012345678901234567
By format with AccountingForm
b = AccountingForm[a, 54]
it becomes
123456789012345678901234567.123456789012345678901234567
How to to parameterise the integer part and the fractional and the
n-digit precision part to produce a number. Like
int=123456789012345678901234567.
fra=.123456789012345678901234567
pre=54
resulting to the same outcome like b above?
UPDATE
A general solution was found.
int = 1234567890123456789012345678900;
fra = 123456789012345678901234567890;
SetPrecision[ToExpression[ToString[int] <> "." <> ToString[fra]],
StringLength[ToString[int]] + StringLength[ToString[fra]]]
is still a number,
1.234567890123456789012345678900123456789012345678901234567890*10^30
now look at it as a string with all digits minutely preserved
ScientificForm[%, ExponentStep -> StringLength[ToString[int]]]
1234567890123456789012345678900.123456789012345678901234567890
Comments
Post a Comment