News for hackers. Stuff that matters.
Re:How does your programming language handle “minus zero” (-... by kingkonz1 on Friday March 05, 2021 @05:20PM (#26362941)
What better alternative is there for handling currencies? Multiplying the original amount by 100 and casting to an int? ($3.50 -> 350)?
Re:How does your programming language handle “minus zero” (-... by danaliv on Friday March 05, 2021 @06:23PM (#26363568)
Use ints. No multiplication necessary. Everything is done in cents. You add/remove the decimal point when doing string conversions.
Re:How does your programming language handle “minus zero” (-... by fiedzia on Saturday March 06, 2021 @01:04PM (#26369208)
Use decimal type for that