Re: [R] engineering notation format

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 07 Jul 2006 - 16:51:48 EST

Both format and formatC (and sprintf) use C facilities for scientific format. As far as I know C has no facilities for your desired format, so you would need to write your own C code and interface to R.

On Thu, 6 Jul 2006, Walker, Sam wrote:

> Hi,
>
> How can I format numbers to engineering notation?
>
> That is, like scientific but where the exponent is always a multiple of
> three.
>
> Some examples:
>
> 1635 000 000 => 1.635E9
> 163 500 000 => 163.5E6
> 0.000 000 000 135 => 135E-9
>
> I've tried format and formatC but I couldn't get them to work they I
> want.
>
> Any help is greatly appreciated.
>
>
> Thanks,
> Sam
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jul 07 16:55:44 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 07 Jul 2006 - 20:15:44 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.