I have a table with numbers like this:
19809.1 1982.0 1982.19
Its currency. Is there a function that I can use to format these numbers?
19 809,10 1 982,00 1 982,19
This is pretty easy with number_format:
number_format
echo number_format($number, 2, ",", " ");
DOCUMENTATION
<?php $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 separator $english_format_number = number_format($number, 2, '.', ''); // 1234.57 ?>
http://www.php.net/manual/es/function.number-format.php
// notación francesa $nombre_format_francais = number_format($number, 2, ',', ' '); // 1 234,56
URL-, http://php.net/number_format
number_format:
$val=array(19809.1, 1982.0, 1982.19); foreach ($val as $v) echo number_format($v, 2, ',', ' '); _ _ _ _ ^ ^ ^ ^ value | | | decimal positions | | decimal separator | thousands separator
:
Source: https://habr.com/ru/post/1532859/More articles:one dependency on multiple modules is r.js ", the next module has the same URL" - javascriptto increase the performance of synchronous asynchronous operations with asynchronous operations - c ++Jenkins / Hudson: How to create periodically only after creating another project - hudsonНе удается получить доступ к службе WCF с использованием привязки NET.TCP - c#boost :: asio async performance - c ++Unable to add service client for net.tcp WCF service - c #What is the correct way to share data between AppWidgetProvider and RemoteViewsService.RemoteViewsFactory - androidHow to override default answers on mockito mock? - javaПроблема IE8 с функцией вызова через пространство имен - javascriptMVC 4 authentication (infinite login) - asp.net-mvc-4All Articles