Skip to content

Commit

Permalink
$mol_number fix minus
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Nov 25, 2024
1 parent 5971986 commit 9f7d7e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion number/number.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace $.$$ {

// Запятые меняем на точки, удаляем не-цифры и не-точки и лишние ноли в начале целой части.
// Минус получится ввести только в начале.
next = (this.value_min() >= 0 && next.startsWith('-') ? '-' : '')
next = (this.value_min() < 0 && next.startsWith('-') ? '-' : '')
+ next.replace(/,/g, '.').replace(/[^\d\.]/g, '').replace(/^0{2,}/, '0')

let dot_pos = next.indexOf('.')
Expand Down

0 comments on commit 9f7d7e1

Please sign in to comment.