Hello Joao, On Thu, 2008-10-16 at 18:33 +0100, Joao Ferreira gmail wrote: > I need some way to format the string of my Y axis in a way that would > allow me to do this > > Y axis tick - Label > 1000 - 1kbit/s > 1000000 - 1Mbit/s > 1000000000 - 1Gbit/s > > well, this is more of a php question really :)
This function should roughly do, what you are intending here.
function format( $number )
{
$identifier = array( 'k', 'M', 'G', 'T', 'P' );
$i = 0;
while ( ( $number > 900 ) &&
( $i <= count( $identifier ) ) )
{
$number /= 1000;
++$i;
}
return sprintf( '%.2f %sbit/s',
$number,
( $i === 0 ? '' : $identifier[$i - 1] )
);
}
> is there a way for the format string to execute some procedure defined
> by myself in order to map Y-tick values to specific strings defined by
> me ?
I don't really get what you are intending here, can you please elaborate
and explain what you are trying to accomplish?
Kind regrads,
Kore
--
Mit freundlichen Grüßen / Med vennlig hilsen
Kore Nordmann (GPG: 0xDDC70BBB)
eZ Components Developer
eZ systems Headquarters
tel +49 (0) 231-9742-7750 | fax +49 (0) 231-9742-7751
[EMAIL PROTECTED] | eZ systems | ez.no
signature.asc
Description: This is a digitally signed message part
-- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
