1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| import digits from './const/const_digit';
|
| function isNumeric(str) {
| return !isNaN(Number(str));
| }
|
| function toFixed(value, bit) {
| if (!isNumeric(value) || !isNumeric(bit)) return value;
| const num = Math.pow(10, bit);
| return Math.round(value * num) / num;
| }
|
| export {
| digits,
| toFixed
| };
|
|