[thelist] Decimal align

aardvark roselli at earthlink.net
Mon Aug 27 20:04:56 CDT 2001


> From: Anthony Baratta <Anthony at Baratta.com>
[...]
> >Can anyone give me an example of how to align numbers in a table
> >column by the decimal point?
> 
> <tr><td>Integer</td><td>.</td><td>decimal</td><tr>

don't forget to align="right" the integer...

another approach i've used on the server side is to count out the 
maximum number of decimals i'll be using (significant digits) and 
adjust all my numbers so they have those decimals in them, even 
it's a whole number with 5 trailing zeros... or hell, run it though 
whatever the currency function is on your platform of choice if 2 
digits after the decimal will do it...

less tabling, less code... but you gotta have server-side scripting 
capability...





More information about the thelist mailing list