I have beginners skills with PHP and hence need your help guys.
What i am trying to achieve is to round up a number for total shares count for a plugin.
my variable is $totalshare
i am using return $totalshare to dispaly the results
i would like to achieve results as following example:
1000 = 1k
1.230 = 1.2k
1489 = 1.5k
1.660 = 1.6k
.
.
.
15576 = 15.6k
.
.
1201200 = 12.02mil
1211200 = 12.12mil
Any help would be much appreciated. Thanks in advance.