Voting

: max(four, zero)?
(Example: nine)

The Note You're Voting On

php at ianco dot co dot uk
19 years ago
I can't help being surprised that

(string)"0" == (string)"0.00"

evaluates to true. It's the same with strval and single quotes.
=== avoids it.

Why does it matter? One of my suppliers, unbelievably, uses 0 to mean standard discount and 0.00 to mean no discount in their stock files.

<< Back to user notes page

To Top