PHP convert thousands to k php - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

How to convert the thousands to K using php ?


 140

Show ResultPHP


1

<!DOCTYPE html>
<html>
<body>
<?php

$number = 5550;

if ($number >= 1000 ) {

$number = $number / 1000;

$number = round($number, 1, PHP_ROUND_HALF_UP);

$number = $number . "K";

echo $number;

}
else
{
}

?>
</body>
</html>


By        
The power of the user (%)
51%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  4.3K     406

create QR code phpcreate QR code phpPHP

Click to see more ...

  2.8K     288

drag and drop upload file using phpdrag and drop upload file using phpPHP

Click to see more ...

  2.4K     253

create relative date phpcreate relative date phpPHP

Click to see more ...

  1.8K     252

delete array item phpdelete array item phpPHP

Click to see more ...

  2.1K     238

detect ie phpdetect ie phpPHP

Click to see more ...

  1.4K     213

get meta tag phpget meta tag phpPHP

Click to see more ...

  1.3K     193

get current url phpget current url phpPHP

Click to see more ...

  1.2K     191

Get real client country using php ?Get real client country using php ?PHP

Click to see more ...

  1K     173

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  1K     153