Skip to content

Commit

Permalink
[Fix] Multi component precision not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
dipaksarkar committed Dec 30, 2023
1 parent e007174 commit 2f84ed5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/number-format.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import defaultOptions, { Options } from './options'
import { Input } from './core'
import { Input, cloneDeep } from './core'

export interface Config {
prefix: string
Expand Down Expand Up @@ -39,7 +39,7 @@ export default class NumberFormat {
negativeRegExp: RegExp

constructor(config?: Options) {
this.options = Object.assign(defaultOptions, config)
this.options = Object.assign(cloneDeep(defaultOptions), config)
const { prefix, suffix, decimal, reverseFill } = this.options

this.input = ''
Expand Down

0 comments on commit 2f84ed5

Please sign in to comment.