integer

integer

Round A Number In MS SQL

To round a number in MS SQL use the ROUND() function. This function takes two parameters, the first is the number to be rounded and the second is the number of decimal places to round the number to. Here is an example of rounding the numbers in a column to the nearest whole integer.

SELECT ROUND(table.column1,0) rentValue FROM table

String Equals Zero In PHP

Due to the weakly-typed nature of PHP you can do some odd things, some of which are good, and some of which will enable you to shoot yourself in the foot. Take the following little snippet.

echo '1' + 5;

In some languages this might cause the program to fall over, but PHP will try to evaluate any string into an integer. In this case it converts the string to an integer 1 and adds this to 5 to make 6.

PHP Function To Turn Integer To Roman Numerals

Use the following function to change any integer into a string containing the integer value as a Roman Numeral.

Does A String In PHP Contain A Number?

The is_numeric() function in PHP can be used to see if a number contained in a string is numeric. The function returns true is the variable can be parsed into a string, otherwise it returns false. Here are some examples: