如何为 HTML 中的价格添加自动点?

How to add automatic dots to prices in HTML?

我正在尝试对网页实施自动格式化。因此,当您输入 12345678 时,它会自动显示为 €123.456,78。

      <div class="form-group">
<input type="text" required class="form-control" name="EKBrutto" placeholder="EK-Brutto">

我不知道该怎么做。

你可以用下面的link来掩盖金钱,特别是你在处理金钱

https://plugins.jquery.com/maskMoney/

下面这个link是一个演示

http://plentz.github.io/jquery-maskmoney/

基本上你拥有的是:

<input type="text" id="currency" />

然后你输入这个脚本

<script>
  $(function() {
    $('#currency').maskMoney();
  })
</script>

这会自动将点放置到位,但还有更多参数可以帮助您阅读指南:)