Posts

Showing posts with the label money_format()

To Format Numerical Value Equally Swedish Currency Using Php

You tin rate the sack run php constituent money_format() that returns a formatted version of number. Note: The constituent money_format() is alone defined if the organization has strfmon capabilities. For example, Windows does not, then money_format() is undefined inwards Windows. I needed a cost to travel formatted equally Swedish currency. So I involve to brand my ain constituent which should work. So I came upwards alongside this slice of code which converts a numerical string to swedish currency format. $price = 10000; echo changeCurrencySwedish($price); //outputs 100,000 constituent changeCurrencySwedish($price) { $price_array = str_split(strrev($price), 3); supply strrev(implode(",", $price_array)); } Sumber http://developer-paradize.blogspot.com