Showing posts with label Numerical Data Type. Show all posts
Showing posts with label Numerical Data Type. Show all posts

is_numeric() And is_int() in PHP

Both is_numeric() and is_int() will return neither TRUE nor FALSE, but null if parameter is null. Logically, it is correct. Practically, it does make these two functions next to useless. Because we human being would never believe null is numeric. For human being, it is obvious...

To make it useful, we would first consider if parameter is null or not, then if it is numeric. Here is simple way to test these three situations once for all:

if (0!=strlen(trim(@$para)) && is_numeric(@$para)) {...};

A Microsoft Usability Bug

in Excel, sometimes the function does not show the calculation result, instead it shows the formula itself. To correct it, one would need to go to Format Cells, change from Text datatype to numerical datatype, such as General.

Technically it is not a bug. In terms of usability, it is. This is because when you change from numerical datatype to text, the calculation still work, until you touched cell, the formula showed up. After that, you won't be able to figure out what went wrong.


http://www.excelforum.com/excel-general/562740-formula-does-not-calculate.html

Labels