当前位置:网站首页>[unity / C] the game has a regional collapse and a deep international pit
[unity / C] the game has a regional collapse and a deep international pit
2022-04-22 19:57:00 【Chengfu still】
The project that is being promoted on a global scale has a strange Bug, The kind that can't be detected by testing the liver explosion . After background data analysis , This weird Bug There is an obvious regional , Almost all appear in Germany and France .
After avoiding all the logic related to internationalization in the code, it still can't be solved .
By chance, it was reproduced by Bulgaria's art brother Bug, original , When the phone is set to Bulgarian , The game will appear Bug, Switch to another language, everything is normal .
After losing dozens of hair in the liver , Finally located the problem , It turned out to be... In the code parsing configuration table float Numerical failure .
Its culprit is float.Parse() Method , original C# Very intimate ( put one 's finger into another 's pie ) Helped us do the internationalization process . In the standards of some countries , Comma is the decimal point !!! So the decimal point in the configuration table float.Parse I don't recognize ."1.5" To write "1,5" To switch normally .
float.Parse() Overloaded methods can be introduced into culture :
Appoint float The parsing method is English standard :
float.Parse("9.99", CultureInfo.CreateSpecificCulture("en-GB"));
Appoint float The analysis method is German standard :
float.Parse("9.99", CultureInfo.CreateSpecificCulture("de-DE"));
all float.Parse() It's not tiring to change everything like this , What if there are other types with standard differences ?
You can directly set the global cultural standards of the system :
using System.Globalization;
CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
This Bug It's simple , It's just expensive ... The amount of money that Germany and France have bought is gone ..
版权声明
本文为[Chengfu still]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221955458129.html
边栏推荐
- The origin explanation and use example of image pre training model
- This is why deep learning is so powerful
- Is it safe to open futures account on mobile phone? Do you need the assistance of offline account manager?
- 2-way can / can FD data recording diagnostic instrument solves the difficulty of accidental errors for enterprises
- New generation agent weapon - traefik
- [Chongqing Guangdong education] Nanyang Institute of Technology English rambling Chinese culture reference materials
- 一文读懂Hoo Smart Chain的可视化公链
- Jmeter:一文2000字接口测试基础知识介绍
- go实现 银行卡Luhn校验
- calico官网网络拓扑实现:基于eNSP与VMVare
猜你喜欢

一文读懂Hoo Smart Chain的可视化公链

What is the reason why easycvr streaming media kernel cannot be started?

2-way can / can FD data recording diagnostic instrument solves the difficulty of accidental errors for enterprises

Those broken things of the tree ~ template summary

2018-8-10-win10-uwp-business game-1.2.1

为什么我建议你从事技术岗,而非文职,销售

Read the visual public chain of Hoo smart chain

Software testing industry must see, a text of 800 words to teach you how to build the allure test report environment
![[leetcode daily question] rotation function](/img/7b/3b83a9a656f97d61f18382f40bd45d.png)
[leetcode daily question] rotation function

x16为什么比x8慢?
随机推荐
Jmeter:一文2000字接口测试基础知识介绍
【牛客刷题19】MP3光标位置
calico官网网络拓扑实现:基于eNSP与VMVare
Go realizes Luhn verification of bank card
DNS resource records detailed explanation & authority | recursive resolution difference (super detailed)
《PyTorch深度学习实践》09 多分类问题
[leetcode daily question] rotation function
启牛商学院理财app下载是不是真的,在启牛开户安全吗
[2022 fresh students see] can an inexperienced college graduate change his career to do software testing?
【八股文】JUC的使用场景及特点
DNS resolution process & Basics
应届毕业生的头一份工作有多重要?
面试千万不要这么说,“不喜欢开发,所以选择测试”
Deux mécanismes de désactivation de la vérification des messages courts et leurs différences
[AI vision · quick review of robot papers today, issue 33] Thu, 21 APR 2022
Golang本地缓存选型对比及原理总结
为什么我建议你从事技术岗,而非文职,销售
[Niuke brush question 19] MP3 cursor position
go语言的时间格式
让模型训练速度提升2到4倍,「彩票假设」作者的这个全新PyTorch库火了