问题描述
我想通过标记数千和数字将数字转换为算术运算到货币的值像这样的数百万
25,685
I want to convert the numbers into arithmetic operations to the values of the currencies by marking the thousands and the millions like this 25,685
Dim dblValue As Double = LAB_VALUE.Text
LAB_RESUT.Text = dblValue.ToString("N", CultureInfo.InvariantCulture)
我希望小数部分仅在有值时出现
I want the decimal part to appear only if there are values for it
NUMBER 25658   CONVERT BECAME X  25,685.00       
我想要 25,685
NUMBER 25658 CONVERT BECAME X 25,685.00 I want 25,685
IF NUMBER 25658,55 我想要
25,685.55
    
IF NUMBER 25658,55 I want25,685.55
推荐答案
给定25685.55(注意我的区域设置小数分隔符是句点)返回25,685.55
Given 25685.55 (note my locale decimal separator is a period) returns 25,685.55
Dim value As Double = 25658.55
Console.WriteLine(value.ToString("N2"))
和
Dim value As Double = 25658
Console.WriteLine(value.ToString("N2"))
成为25,658.00。你怎么看待25.685?规则是什么,因为这是不正确的。
Becomes 25,658.00. How do you expect that to be 25.685 ? What is the rule as this is not correct.
这篇关于将数字转换为货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!