Templat:Formatprice/digits
This sub-template takes a number and reformats it to only 3 digits and a dot (if needed), provided it's in the 0–999.9999..... range. It's used internally by {{Formatprice}} for producing pleasant looking numbers, and isn't meant to be called directly. Its behavior outside the specified range isn't planned for and will result in an undefined, although probably consistent (in some way), result.
Usage sunting
{{Formatprice/digits|number}}
Examples sunting
-
{{Formatprice/digits|0}}
= 0 -
{{Formatprice/digits|0.12345}}
= 0.12 -
{{Formatprice/digits|1.23456}}
= 1.23 -
{{Formatprice/digits|12.3456}}
= 12.3 -
{{Formatprice/digits|123.456}}
= 123 -
{{Formatprice/digits|1234.56}}
= 1235 -
{{Formatprice/digits|-234.56}}
= -234.56
See also sunting
- {{Formatprice}}
Pendokumenan di atas ditransklusikan daripada Templat:Formatprice/digits/doc. (sunting | sejarah) Para penyunting boleh membuat percubaan di laman kotak pasir (cipta | cermin) dan kes ujian (cipta) templat ini. Sila letakkan kategori di sublaman /doc. Sublaman templat ini. |