简体   繁体   English

如何为 label 设置货币格式

[英]How to set the currency format for a label

I want to show the currency format for the tow labels like this "150,000,000"我想显示像“150,000,000”这样的拖车标签的货币格式

this is my code这是我的代码

cn.Open();
            cm = new SqlCommand("SELECT SUM(price*qty),SUM(buy_price*qty) FROM tblproduct", cn);
            dr = cm.ExecuteReader();
            while (dr.Read())
            {

                lblTprice.Text = dr[0].ToString();
                lblTbuyPrice.Text = dr[1].ToString();
                

            }
            dr.Close();
            cn.Close();
lblTprice.Text = dr[0].ToString("C", CultureInfo.CurrentCulture);
lblTbuyPrice.Text = dr[1].ToString("C", CultureInfo.CurrentCulture);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM