Currency data type: wrong calculations and comparison!

Richard, I think you just have to drag “Money” from that project to yours, then Dim As New Money as in the example.

what i mean is if the code is on the xojo forum and i want to create a class with those code…

Xojo does not have or allow a “view all code” and copy/paste of entire textual sections (There’s an old request for that). I wrote that code as an example, by hand, using an invented by myself, but understandable, Xojo object description syntax, so people should create their “parts” one by one based on that code. As you requested, I wrote it in native Xojo, enhanced a bit, and shared it. Open the example, the class is there, cut things out and add new ones as you wish. – Rick. :wink:

New version. Forget the older one. This now complies to IEEE Standard 754, section 4. Bank’s rounding is the default for the money class but arithmetic options are present for special needs (like LoadA(), RoundA(), RoundCentsA()).

Now m.Load(1.5555).Round() -> 2 and m.Load(1.5555).RoundCents() -> 1.56

There are more methods, check the code.

https://drive.google.com/file/d/1su_1Ah4CE9aCuLoJdOQ81Yu0FSTvzPAA/view?usp=sharing

WTHeck? Did i miss something? (Sorry for asking offtopic here!)

I think the reference was “stepping out (from the forums)”

Money Class 2.1

Updated: Mult() and Div() including rounding to 4 decimals for results with more than 4 decimals (Banker’s rounding)
Added: MultA() and DivA(), the arithmetic rounding counterparts

Same link: https://drive.google.com/file/d/1su_1Ah4CE9aCuLoJdOQ81Yu0FSTvzPAA/view?usp=sharing

Money Class 2.3 Out

https://drive.google.com/file/d/1su_1Ah4CE9aCuLoJdOQ81Yu0FSTvzPAA/view?usp=sharing

Many enhancements and bug fixes. You MUST update it.