转换flot值 [英] convert flot values

查看:117
本文介绍了转换flot值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我在cs页面中有一个变量,类型为Float,

,这个变量值显示在文本框99.3333

我想要在文本框99.33中显示所以给我一些关于如何转换它的想法

谢谢

hi I have a variable in the cs page with the type Float,
and this variable values are display in text box 99.3333
and i want to display in text box 99.33 so give me some idea about this how to convert it
Thanks

推荐答案

try this,...

txtOutput.Text is ur textbox name and lblRate.Text is ur Float variable name

 txtOutput.Text = Math.Round(Convert.ToDecimal(lblRate.Text), 2).ToString();


TrRy this



双Val = Math.Round(99.3333,2);
TrRy this

double Val= Math.Round(99.3333, 2);




检查一下。

Hey
Check this.
Double  DblValue = 333.4567;
string StrValue = DblValue.ToString(".##");
//Answer will be 333.46.



问候


Regards


这篇关于转换flot值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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