【问题标题】:How to add automatic dots to prices in HTML?如何在 HTML 中为价格添加自动点?
【发布时间】:2016-08-31 08:17:58
【问题描述】:

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

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

我不知道该怎么做。

【问题讨论】:

标签: javascript php html mysql price


【解决方案1】:

您可以使用以下链接来掩盖金钱,尤其是您正在处理金钱

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

以下链接是一个演示

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

基本上你拥有的是:

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

然后你把这个脚本放进去

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

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

【讨论】:

    猜你喜欢
    • 2021-11-16
    • 2021-09-17
    • 2021-06-19
    • 1970-01-01
    • 2012-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多