|
@@ -225,6 +225,14 @@ export const formatDecimal = function (num, decimal) {
|
|
|
}
|
|
|
return parseFloat(num).toFixed(decimal)
|
|
|
}
|
|
|
+
|
|
|
+export const toThousands = (num) => {
|
|
|
+ return num.toString().replace(/\d+/, function (n) {
|
|
|
+ return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) {
|
|
|
+ return $1 + ','
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
export const justNumber = function (val) {
|
|
|
let _value = val + ''
|