shivamsouravjha / stock-frontend

https://www.stocksight.online/
9 stars 19 forks source link

Fix logic for the toNumber util function #17

Closed devjayprakash closed 1 month ago

devjayprakash commented 1 month ago

Current behaviour The logic for the toNumber (https://github.com/shivamsouravjha/stock-frontend/blob/master/src/utils/common.js) utils function does not work properly for floating point number as it does not consider dot ".".

So it converts 2.34 to 234

Expected behaviour It should consider dots "." as well while converting string.

Fix In the regex we should include matching "dots "as well.

devjayprakash commented 1 month ago

Fixed in #27