You just need to truncate the resultant number to the number of decimal places you want. This is a common need, so it crops up everywhere. In MySQL, for instance, you use the truncate() function; in PHP you use number_format. Specific code will depend on whether you want to round off the number to the shorter version or just truncate it without rounding. A Google search will give you lots of examples of how to do this. Just pick what you want to use (in this example PHP) and search for something like php truncate number.