Manikandan Ram Manikandan Ram - 2 months ago 11x
Javascript Question

How to convert price format string into number in jquery

I have a string like this


"$" maybe any symbol, like @,#..etc.

I want to convert this into 2099585.43

Is there any simple way to do this?


Use String#replace and remove characters which are not a digit or dot.

  "$2,099,585.43".replace(/[^\d.]/g, '')