extjs 如何控制数字精度(小数位数)
3个回答
展开全部
var numFormated = Ext.util.Format(num,'0.00'粗早);//'0,00'为format定义
examples (123456.789):
0 - (123456) show only digits, no precision
0.00 - (123456.78) show only digits, 2 precision
0.0000 - (123456.7890) show only digits, 4 precision
0,000 - (123,456) show comma and digits, no precision
0,000.00 - (123,456.78) show comma and digits, 2 precision
0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision
To reverse the grouping (,) and decimal (.) for international numbers, add /帆睁i to the end. For example: 0.000,00/态凳岁i
examples (123456.789):
0 - (123456) show only digits, no precision
0.00 - (123456.78) show only digits, 2 precision
0.0000 - (123456.7890) show only digits, 4 precision
0,000 - (123,456) show comma and digits, no precision
0,000.00 - (123,456.78) show comma and digits, 2 precision
0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision
To reverse the grouping (,) and decimal (.) for international numbers, add /帆睁i to the end. For example: 0.000,00/态凳岁i
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
var numFormated = Ext.util.Format.number(num,'0.00');
这样才拦尺戚对,要困如用Format下的number方法,被忽悠的浪费好长简陵时间
这样才拦尺戚对,要困如用Format下的number方法,被忽悠的浪费好长简陵时间
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一楼正解
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询