php: round up and down to nearest cents

by prettyscripts on 2009-09-29 10:22:17 • Leave a comment »

php

use php functions round() to round up or floor() to round down. generic code, based on examples to round to nearest nickel (5c), dime (10c) and quarter (25c):$x = 100 / $cents_to_round_to;$round_up = number_format(round($number * $x) / $x, 2);$… more »

Tags: cents, php, rounding

xajax: append form fields and firefox

by prettyscripts on 2009-09-15 14:43:56 • Leave a comment »

phphtmlxajax

a case that works in IE but not firefox. supposed there’s form with a few fields. a button to manually adding more fields to the form. these fields are grouped under the same <div> tag. when the fields are added to the form, the original field va… more »

Tags: append, field, form, php, xajax

symfony: iphone version of the website

by prettyscripts on 2009-09-14 12:54:00 • Leave a comment »

symfony

just follow this documentation. it’s written for symfony 1.1, but it works on V1.2. templates a few notes that's not explicitly written in the doc. for every template file you need an iphone version. or it will break - depends on your server setting… more »

Tags: iphone, symfony