PHP Classes
elePHPant
Icontem

File: sets/si_long.set.php

Recommend this page to a friend!
  Classes of Alex F. Bustos  >  SI Prefix Converter  >  sets/si_long.set.php  >  Download  
File: sets/si_long.set.php
Role: Auxiliary script
Content type: text/plain
Description: SI prefixes in long format
Class: SI Prefix Converter
Convert a number to a string appending a prefix
Author: By
Last change: 1.2 Version. Changed, backward compatible with 1.1. Corrected and added short sets and spanish long version of the prefixes.
Date: 3 years ago
Size: 645 bytes
 

Contents

Class file image Download
<?php
//Long version prefixes - Taken from https://en.wikipedia.org/wiki/International_System_of_Units in 27/05/2014
$sci_list=array(
    -
24=>array('yocto'),
    -
21=>array('zepto'),
    -
18=>array('atto'),
    -
15=>array('femto'),
    -
12=>array('pico'),
    -
9=>array('nano'),
    -
6=>array('micro'),
    -
3=>array('milli'),
    -
2=>array('centi'),
    -
1=>array('deci'),
   
0=>array(''),
   
1=>array('deca'),
   
2=>array('hecto'),
   
3=>array('kilo'),
   
6=>array('mega'),
   
9=>array('giga'),
   
12=>array('tera'),
   
15=>array('peta'),
   
18=>array('exa'),
   
21=>array('zetta'),
   
24=>array('yotta')
);
//Common used settings
$sci_min = -12;
$sci_max = 12;
$sci_base = 10;
$sci_space = 3;