保留兩位小數通用方法
// 金額格式化保留2位小數 2 -> 2.00 2.1 -> 2.10
function getFDataFixed (source, length = 2) {
return (+String(source)).toFixed(length) // +String(source) 字符轉數字
}
保留兩位小數通用方法
// 金額格式化保留2位小數 2 -> 2.00 2.1 -> 2.10
function getFDataFixed (source, length = 2) {
return (+String(source)).toFixed(length) // +String(source) 字符轉數字
}