First: When entering the entry amount. Enter the salary of the first employee: 12854,89
I CAN’T PUT A COMMA TO ADD THE NUMERICAL VALUE.
Second: When generating the mean value(double), as I do to have only two decimal places after the virgular/dot.
1
https://answall.com/q/16276/112052 - click on [Edit] and put the code as text. Putting it as an image is not ideal, understand the reasons reading the FAQ.
I appreciate the tip cleared one of my doubts. You could tell me First: When entering the input value. Enter the salary of the first employee: 12854,89 I CANNOT PUT A COMMA TO ADD THE NUMERICAL VALUE. This value I can only add if there is a point(.), if there is a comma(,) error.
To documentation says that parseDouble uses the same rules of valueOf, which in turn only accepts the point. If you want the comma, you have to use NumberFormat. Ex: https://ideone.com/zG4sP8
https://answall.com/q/16276/112052 - click on [Edit] and put the code as text. Putting it as an image is not ideal, understand the reasons reading the FAQ.
– hkotsubo
I appreciate the tip cleared one of my doubts. You could tell me First: When entering the input value. Enter the salary of the first employee: 12854,89 I CANNOT PUT A COMMA TO ADD THE NUMERICAL VALUE. This value I can only add if there is a point(.), if there is a comma(,) error.
– Gabriel Henrique
To documentation says that
parseDouble
uses the same rules ofvalueOf
, which in turn only accepts the point. If you want the comma, you have to useNumberFormat
. Ex: https://ideone.com/zG4sP8– hkotsubo