Angular 6 Keyup自动货币

时间:2019-07-11 10:09:16

标签: angular

我试图在Angular 8的带有货币管道的输入元素中使用keyup

<input placeholder="€0.00" (keyup)="onKey(pointIndex, $event.target.value, item.quantity)" value="{{item.unitPriceWithVat | currency:currency_code:'symbol-narrow':'1.2-2'}}"/>

当我在内部写一些数字时,它会自动格式化为200.00或1,230.00,但是问题是,如果我尝试在输入中尝试写一些数字(假设12,345.00),则会将数字格式化为以下格式:12.34

DEMO http://www.theme-oxygen.com/test/index.html

有人可以帮我解决这个问题! 在此先感谢!

1 个答案:

答案 0 :(得分:1)

问题出在您的 withEnv(['PATH+EXTRA=/busybox:/kaniko']) { sh '''#!/busybox/sh /kaniko/executor (....) } 函数中,此行在这里:

onKey

let priceValue = parseFloat(price.replace(/[^0-9.,]+/g, '')); parseFloat之类的值转换为12,345.00。您需要更改此行以同时替换12

,