如何以正确的格式显示价值 [英] how to show value in proper format

查看:70
本文介绍了如何以正确的格式显示价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名称为"txtsendingAmount"的文本框

我从属性设置的空值为0.00

当我运行页面并在文本框中输入12而不删除0.00

我想显示12.00

但它正在显示
0.0012

我该如何解决此错误

i have a text box with name "txtsendingAmount"

the null value i set from property is 0.00

when i run my page and enter the 12 in my text box without remove the 0.00

i want to show 12.00

but it is displaying
0.0012

how can i solve this error

推荐答案

这不是错误.这是HTML元素的行为方式.如果要清除文本框的焦点,请使用此
This is not an error. It is how a HTML element should behave. If you want that the textbox should be cleared on focus, then use this
<input type="text" value="0.00"  önfocus="this.value='';"></input>


这篇关于如何以正确的格式显示价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆