Yeah it rounds to the nearest cent in this case, the question becomes then do we want it to work that way, or do we say "Hey you don't have a full cent" so it always rounds down?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm not sure, but I think that "Sprintf" rounds to nearest integer.
Try with a value like 3.149 if still returns 3.14 or 3.15
Added additional test case to clarify current rounding behavior.
Yeah it rounds to the nearest cent in this case, the question becomes then do we want it to work that way, or do we say "Hey you don't have a full cent" so it always rounds down?