From 9e1a5323b861931d86d4338f64601f449a2ab83c Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sun, 3 Aug 2014 10:47:41 +0200 Subject: [PATCH] Added comment for a piece of confusing code --- src/Utility/Number.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Utility/Number.php b/src/Utility/Number.php index 43258ab6f3a..63469269a88 100644 --- a/src/Utility/Number.php +++ b/src/Utility/Number.php @@ -280,6 +280,10 @@ public static function currency($value, $currency = null, array $options = array } if (!empty($options['useIntlCode'])) { + // One of the odd things about ICU is that the currency marker in patterns + // is denoted with ¤, whereas the international code is marked with ¤¤, + // in order to use the code we need to simply duplicate the character wherever + // it appears in the pattern. $pattern = trim(str_replace('¤', '¤¤ ', $formatter->getPattern())); $formatter->setPattern($pattern); }