Rounding in number conversion

Hello everyone

I am grateful for the interest and scope of the following:

I have the following operation:

  Dim number1 As Double=76142.07
  Dim number2 As Double=75990.60
  Dim amount AS double
  MsgBox "amount no format"+str(amount)
  MsgBox "amount with format "+str(amount,"##########.00")

the values shown in the MsgBox are different

the str function without format automatically rounds the conversions?

All your comments will be greatly appreciated


Raul Juarez Pulache
Notes: For real numbers, Str returns 7 decimal places. In most cases, this translates to 7 significant digits.

I think that’s why str returns your number with only .7 and not .67, because it has 6 digits before the decimal point.

ETA: You can learn about .ToText, that may help you. Instead of str(amount) you could use amount.ToText

Thank you so much
Alberto De Poo

With your help you can understand the difference and it is basically by translates to 7 significant digits

Raul Juarez Pulache