Closed VirginiaDooley closed 1 month ago
This works for 45.5
-> 46
, but 54%
goes to NaN
as does 12,34
-> NaN
.
Clearly 12,34
isn't correct as a percent, but I think it shouldn't convert to NaN
in this case. Can we change the regex to match replace any non-numeric or non-.
?
This fixes a previous PR that sought to remove decimals and round percentages to the nearest whole number. This commit rounded before removing, resulting in a greater than expected result such as 50.55 becomes 5055.
This change refactors the order of operations and handles non-numeric symbols before rounding percentages to the nearest whole number