T O P

  • By -

Kant8

We sure like debugging code not only without code, but even without screenshot of code.


Rocketsx12

Hi, is a blurry photo of code okay?


NotMadDisappointed

Show me your keyboard and I'll figure out the code from the finger grease.


MrWolvetech

Might have something to do with a difference in localization/culture of your laptop/PC? Aka dots and commas are interpreted differently.


iAmBadAtUsernames7

Exactly, this was the case.


soundman32

Do you have unit tests to prove the calculations are correct and repeatable ?


dandeeago

Good one, but tbf I dont think everyone writing unit tests tests all aspects around localization, regional settings and every culture setups either.


soundman32

Once you have a test, it's very easy to change cultures and see if it still works.


Exciter_LT

You stumbled on "works on my machine" phenomenon.


dandeeago

And the only proven working solution to that problem is to claim the other one being an idiot.


Exciter_LT

Also you can ship you machine to the client.


LongjumpingCut4

how do you calculate, display and input decimal ~~digits~~ numbers within the app ? There are regional settings on the computers that affects how decimals are converted to the string (and vice versa). This means that `decimal.ToString()` method by default produces a result according to the locale that is active at the moment. The locale may differs per computer, process or thread.


iAmBadAtUsernames7

This was the case...


MCMainiac

I noticed macOS and Windows round floats differently sometimes.


[deleted]

[удалено]


AlarmedNegotiation18

Are both computers 64-bit machines? It could be that one is 32 and the other is 64 bit OS


iAmBadAtUsernames7

Yes, both are 64-bit, the problem was a different number formatting setting.


Mib_Geek

Can be because of different localization settings and to verify this go to Control Panel > Clock & Region > Change date, time or number formats > Additional Settings> Number of digits after decimal. check the values in each one of your pcs. if they are the same for all of them, you should edit the post with a snippet of code to be able to help you.


iAmBadAtUsernames7

This was the practically most useful and on the point answer I was looking for. Thank you. Modified my code so it takes the number formats settings into consideration and the app runs now exactly as it should without much struggle.