diff options
Diffstat (limited to 'src/utils/simpleFormat.ts')
| -rw-r--r-- | src/utils/simpleFormat.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/simpleFormat.ts b/src/utils/simpleFormat.ts new file mode 100644 index 0000000..0985546 --- /dev/null +++ b/src/utils/simpleFormat.ts @@ -0,0 +1,9 @@ +/** +* @name simpleFormat +* @param {number|string} value Value to format +* @returns {number} A number in fixed-point notation up to 2 decimal points +*/ +module.exports = value => { + const result = parseFloat(parseFloat(value).toFixed(2)); + return result; +};
\ No newline at end of file |