Formatted decimal numbers in language translation strings Topic is solved

General questions regarding the use of languages in Joomla! 3.x.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
gba
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Tue Jun 03, 2014 3:37 pm

Formatted decimal numbers in language translation strings

Post by gba » Wed Feb 26, 2020 2:31 pm

Hello!

During my research I found that "outdated" thread:
viewtopic.php?t=773166

If anyone would need an answer on sanderv's question, here is my solution:

Code: Select all

$lang = JFactory::getLanguage();
$nf = new \NumberFormatter($lang->getTag(), \NumberFormatter::DECIMAL);
echo($nf->format(12.45));
Kind regards,
Gerald

 
User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18937
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Formatted decimal numbers in language translation strings

Post by infograf768 » Thu Feb 27, 2020 7:56 am

Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

 

Post Reply

Return to “Language - Joomla! 3.x”