The JS format currency retains the decimal and removes the 0 after the decimal.

for example, 0.00040000 needs to be converted to 0.0004
. It can be formatted normally with parseFloat, but if it encounters 0.00000007 like this, it will display scientific operations.
is there any way to prevent him from displaying scientific computing and formatting it

Mar.30,2021

is converted to a string for processing


use regular matching

var str = '0.000000000700'
var result = str.match(/.*[1-9]/)[0] // 0.0000000007
Menu