.Net Core 迁移之坑二 《ToString("F") 输出与windows不一致问题》

大家都知道 ToString("F") 是干什么的

平时也是这么用的

一切正常,直到发布到linux上面后

一串日志出来了

{"name":"VALIDATION_ERROR","details":[{"field":"transactions.amount","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"eecc8c8017432"}

果然是这样。

文化差异啊!解决

猜你喜欢

转载自www.cnblogs.com/zhaozhengyan/p/ToString_nvariantCulture_onlinux.html