gpt4 book ai didi

c# - 将带点的字符串转换为带欧元的货币,

转载 作者:太空宇宙 更新时间:2023-11-03 13:56:19 25 4
gpt4 key购买 nike

我有这样一个字符串:“44.00000000000”

在这种情况下,点是小数点,我正在尝试转换为欧元货币。但有问题

请看截图

enter image description here

最佳答案

更改您的小数解析行以使用以下内容:

decimal.Parse(inputString, CultureInfo.InvariantCulture)

你可能想在这里读一读:

http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.invariantculture.aspx

关于c# - 将带点的字符串转换为带欧元的货币,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12052610/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com