📅  最后修改于: 2022-03-11 15:02:11.750000             🧑  作者: Mango
[7, 7.5, -7.2345].forEach(myNumber => {
let formattedNumber = myNumber.toLocaleString('en-US', {
minimumIntegerDigits: 2,
useGrouping: false
})
console.log(
'Input: ' + myNumber + '\n' +
'Output: ' + formattedNumber
)
})
Run code snippetHide results