【问题标题】:HTML5: Is there any way to change comma to space in input-type-number?HTML5:有没有办法将输入类型数字中的逗号更改为空格?
【发布时间】:2011-06-03 10:20:48
【问题描述】:

有没有办法将输入类型编号中的逗号更改为空格? (不带 javascript)

默认情况下,它在 3 位数字后用逗号 (,) 格式化(拆分)数字。

有什么想法吗?

【问题讨论】:

标签: html input types webforms numbers


【解决方案1】:

没有任何可用于输入类型编号的自定义。 只能在点分隔和不分隔之间切换。

所以,要显示数字 93.991,请使用:

<input type="number" step="0.001">

或者如果需要更高的精度 (93.9911),请使用

<input type="number" step="0.0001">

或者如果只需要使用整数:

<input type="number" step="1">
<input type="number" step="0,5">

在 Google Chrome 版本 34.0.1799.0 canary 中测试

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-11
    • 2012-07-29
    • 1970-01-01
    • 2013-11-19
    • 1970-01-01
    • 1970-01-01
    • 2017-06-02
    相关资源
    最近更新 更多