Skip to content

Commit 2f84ed5

Browse files
committed
[Fix] Multi component precision not working properly
1 parent e007174 commit 2f84ed5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/number-format.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import defaultOptions, { Options } from './options'
2-
import { Input } from './core'
2+
import { Input, cloneDeep } from './core'
33

44
export interface Config {
55
prefix: string
@@ -39,7 +39,7 @@ export default class NumberFormat {
3939
negativeRegExp: RegExp
4040

4141
constructor(config?: Options) {
42-
this.options = Object.assign(defaultOptions, config)
42+
this.options = Object.assign(cloneDeep(defaultOptions), config)
4343
const { prefix, suffix, decimal, reverseFill } = this.options
4444

4545
this.input = ''

0 commit comments

Comments
 (0)