File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -619,7 +619,12 @@ Vue.component('currency-input', {
619
619
// Remove whitespace on either side
620
620
.trim ()
621
621
// Shorten to 2 decimal places
622
- .slice (0 , value .indexOf (' .' ) + 3 )
622
+ .slice (
623
+ 0 ,
624
+ value .indexOf (' .' ) === - 1
625
+ ? value .length
626
+ : value .indexOf (' .' ) + 3
627
+ )
623
628
// If the value was not already normalized,
624
629
// manually override it to conform
625
630
if (formattedValue !== value) {
@@ -653,7 +658,12 @@ Vue.component('currency-input', {
653
658
updateValue : function (value ) {
654
659
var formattedValue = value
655
660
.trim ()
656
- .slice (0 , value .indexOf (' .' ) + 3 )
661
+ .slice (
662
+ 0 ,
663
+ value .indexOf (' .' ) === - 1
664
+ ? value .length
665
+ : value .indexOf (' .' ) + 3
666
+ )
657
667
if (formattedValue !== value) {
658
668
this .$refs .input .value = formattedValue
659
669
}
You can’t perform that action at this time.
0 commit comments