8000 [Intl] Added round support for ROUND_CEILING, ROUND_FLOOR, ROUND_DOWN, ROUND_UP by pamil · Pull Request #9895 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Intl] Added round support for ROUND_CEILING, ROUND_FLOOR, ROUND_DOWN, ROUND_UP #9895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
< 8000 svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="flex-1 anim-rotate"> Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved spelling: "unitialized" -> "uninitialized"
  • Loading branch information
pamil committed Dec 30, 2013
commit 1be2204924da719eca284c18ac823b2b478d92ff
10 changes: 5 additions & 5 deletions src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ private function roundCurrency($value, $currency)
*/
private function round($value, $precision)
{
$precision = $this->getUnitializedPrecision($value, $precision);
$precision = $this->getUninitializedPrecision($value, $precision);

$roundingModeAttribute = $this->getAttribute(self::ROUNDING_MODE);
if (isset(self::$phpRoundingMap[$roundingModeAttribute])) {
Expand Down Expand Up @@ -756,20 +756,20 @@ private function round($value, $precision)
*/
private function formatNumber($value, $precision)
{
$precision = $this->getUnitializedPrecision($value, $precision);
$precision = $this->getUninitializedPrecision($value, $precision);

return number_format($value, $precision, '.', $this->getAttribute(self::GROUPING_USED) ? ',' : '');
}

/**
* Returns the precision value if the DECIMAL style is being used and the FRACTION_DIGITS attribute is unitialized.
* Returns the precision value if the DECIMAL style is being used and the FRACTION_DIGITS attribute is uninitialized.
*
* @param integer|float $value The value to get the precision from if the FRACTION_DIGITS attribute is unitialized
* @param integer|float $value The value to get the precision from if the FRACTION_DIGITS attribute is uninitialized
* @param int $precision The precision value to returns if the FRACTION_DIGITS attribute is initialized
*
* @return int The precision value
*/
private function getUnitializedPrecision($value, $precision)
private function getUninitializedPrecision($value, $precision)
{
if ($this->style == self::CURRENCY) {
return $precision;
Expand Down
0