Search code examples
javascriptparseinttrailing

parseInt is trimming trailing zeroes after comma javascript


I am stuck in a solution in which I am trying to convert the string to integer, but it truncates the zeroes after comma.Any help on this is much appreciated. For example,

parseInt("3,50,000") // 3  ==> what i actually need is 3,50,00 of integer type

enter image description here


Solution

  • console.log(parseInt("3,50,000".split(',').join('')))