Change decimal separator

I need your help again.

I am reading various amounts from an Excel file. And I would like to calculate the net amount.

Gross amount/1+tax rate

Then I round up to 2 decimal places.

My result is 7076.14, but the correct amount would be 70,76.

Can you help me?

Many thanks in advance

Nina

image

Hi Nina,
Hold your process after reading the values and have a look at the variables you are calculating with later. Make sure the variable types of the variables you are reading in Excel are correct.

Probably it is also the issue between languages German and English, where the separator differs (,) and (.). You can change the separator with .Replace(“.”,“”).Replace(“,”,“.”).
This would first eliminate your “thousand separators” and then replace “,” with “.”.

Hi,
that was a good tip. The error already occurred when reading out the data. I was able to correct the error.

Many thanks and best regards
Nina

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.