Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 263 Bytes

parse-price.md

File metadata and controls

12 lines (9 loc) · 263 Bytes

How to parse a price string

In order to parse the $1,598.99 price, you can use the following snippet:

function parsePrice(str) {
    return parseFloat(str.replace(/[$,]/g, ""));
}

References: