Skip to content

Commit

Permalink
Added comment for a piece of confusing code
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Aug 3, 2014
1 parent 0572c81 commit 9e1a532
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Utility/Number.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9e1a532

Please sign in to comment.