The val()
function seems to understand .
as a decimal point, even on systems with ,
as a decimal point. For example, the following call
val("7,3") + 1,4
returns the real number 8,4
(8.4
in English notation). val("7.3") + 1,4
returns the expected value 8,7
.
Is this a feature or a bug? How can I specify which decimal point will be used in function val()
?
According to the documentation:
Note The
Val
function recognizes only the period (.
) as a valid decimal separator. When different decimal separators are used, as in international applications, useCDbl
instead to convert a string to a number.
Note: Val(7,3)+1,4
also returns 8,4
, so be careful if your input already is in the number format!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With