Add fixed decimals to toFloat util
This commit is contained in:
@@ -147,8 +147,8 @@ function toInteger(val) {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function toFloat(val) {
|
||||
return parseFloat(val);
|
||||
function toFloat(val, fixed = 2) {
|
||||
return parseFloat((val).toFixed(fixed));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user