0

Getting some exponential value in qtp/uft while performing multiplication with huge numbers. But I want the exact decimal value of it.

E.g.: I am getting something like 15525.22352000e25

I need the exact value of it like 15525.22352554585.......

  • Numbers are examples, Not exact :)

I need it for at least 15 decimal digits

2

Numbers in computations

Exponential representation of numbers is used for Double data type (15 significant digits, so called mantissa, and E-part, so called exponent).

Let's see your example 15525.22352000e25. It is converted to Double because it is greater than the biggest integer data type Long (values from -2,147,483,648 to 2,147,483,647)

There is another data type Currency but it is limited by values from -922,337,203,685,477.5808 to 922,337,203,685,477.5807 (it's about 9.2e14) so it's not enough to store you number 15525.22e25 without conversion to Double.

So there is no way to store 15525.22352000e25 without loosing some accuracy. This example needs 30 significant digits.

But as you said:

need it for at least 15 decimal digits

Double data type is just what you need, it has 15 significant digits:

Contains a double-precision, floating-point number in the range -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.

Numbers in string output

If you need just to show this number without exponent part to user you can use FormatNumber(number) function:

FormatNumber(15525.22352000e25)
' Output: "155 252 235 200 000 000 000 000 000 000,00"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.