[英]How to properly convert string to decimal in VB.net
I have a string我有一个字符串
Dim value as String = "10.00"
when I try to convert it and store in a decimal variable, I get invalid input exception当我尝试将其转换并存储在十进制变量中时,出现无效输入异常
Dim valueDec as Decimal = Convert.ToDecimal(value)
How can I safely convert it?我怎样才能安全地转换它?
Okay, I changed '.'好的,我改变了'。 to ',' and the problem is gone.到“,”,问题就消失了。 Well done VB VB干得好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.