Skip to content

Commit

Permalink
$mol_number fix leading zero format
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Nov 24, 2024
1 parent 92ad887 commit cbb919b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions number/number.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace $.$$ {
next === undefined
? next
: next === '-' || next === '.'
? $mol_wire_probe(() => this.value_limited()) ?? 0
? $mol_wire_probe(() => this.value_limited())
: Number(next || Number.NaN)
)

Expand Down Expand Up @@ -61,7 +61,7 @@ namespace $.$$ {
const dot_pos = next.indexOf('.')

if (dot_pos !== -1) {
next = next.slice(0, dot_pos) + '.' + next.slice(dot_pos + 1).replace(/\./g, '')
next = (next.slice(0, dot_pos) || '0') + '.' + next.slice(dot_pos + 1).replace(/\./g, '')
}

this.value_normalized( next )
Expand Down

0 comments on commit cbb919b

Please sign in to comment.