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