Friday, January 15, 2010

fpdf number_format()

number_format

(PHP 4, PHP 5)

number_format — Format a number with grouped thousands

string number_format ( float $number , int $decimals , string $dec_point , string $thousands_sep )
----------------------------------------------------------------------------------------------

number

The number being formatted.
decimals

Sets the number of decimal points.
dec_point

Sets the separator for the decimal point.
thousands_sep

Sets the thousands separator.

Only the first character of thousands_sep is used. For example, if you use bar as thousands_sep on the number 1000, number_format() will return 1b000.

----------------------------------------------------------------------------------------------


Example #1 number_format() Example

For instance, French notation usually use two decimals, comma (',') as decimal separator, and space (' ') as thousand separator. This is achieved with this line :

$number = 1234.56;

// english notation (default)
$english_format_number = number_format($number);
// 1,235

// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56

$number = 1234.5678;

// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57

?>

How to install Google Chrome in Fedora 10 or Fedora 11

To install chromium, create a chromium.repo file in your /etc/yum.repos.d directory.

vim /etc/yum.repos.d/chromium.repo
--------------------------------------------------------------------------------------
Then fill it up with this:-

[chromium]
name=Chromium Test Packages
baseurl=http://spot.fedorapeople.org/chromium/F$releasever/
enabled=1
gpgcheck=0
--------------------------------------------------------------------------------------
After that, just yum install chromium
--------------------------------------------------------------------------------------
[root@atreides ~]# yum install chromium
Loaded plugins: fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirror.oscc.org.my
* rpmfusion-free: mirror.transact.net.au
* rpmfusion-free-updates: mirror.transact.net.au
* rpmfusion-nonfree: mirror.transact.net.au
* rpmfusion-nonfree-updates: mirror.transact.net.au
* updates: ftp.riken.jp
chromium | 1.2 kB 00:00
chromium/primary | 2.4 kB 00:00
chromium 7/7
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package chromium.i586 0:3.0.191.0-0.1.20090628svn19474.fc11 set to be updated
--> Processing Dependency: libv8.so.0 for package: chromium-3.0.191.0-0.1.20090628svn19474.fc11.i586
--> Running transaction check
---> Package v8.i586 0:1.2.9-1.20090626svn2284.fc11 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
chromium i586 3.0.191.0-0.1.20090628svn19474.fc11 chromium 11 M
Installing for dependencies:
v8 i586 1.2.9-1.20090626svn2284.fc11 chromium 858 k

Transaction Summary
================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 12 M
(1/2): chromium-3.0.191.0-0.1.20090628svn19474.fc11.i586 | 11 MB 01:11
(2/2): v8-1.2.9-1.20090626svn2284.fc11.i586.rpm | 858 kB 00:06
--------------------------------------------------------------------------------
Total 149 kB/s | 12 MB 01:19
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : v8-1.2.9-1.20090626svn2284.fc11.i586 1/2
Installing : chromium-3.0.191.0-0.1.20090628svn19474.fc11.i586 2/2

Installed:
chromium.i586 0:3.0.191.0-0.1.20090628svn19474.fc11

Dependency Installed:
v8.i586 0:1.2.9-1.20090626svn2284.fc11

Complete!