Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

CurrencyBundle::getRoundingIncrement() always retruns 0 #21247

Copy link
Copy link
Closed
@enumag

Description

@enumag
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.1.7

I'm solving certain issues with currencies and rounding in our system. While doing that I noticed method NumberFormatter::roundCurrency() which applies something called "Swiss rounding"? I'm not quite sure what it is about but it calls method Intl::getCurrencyBundle()->getRoundingIncrement($currency);. Now here is the strange thing, this method currently returns 0 for all currencies - meaning that the swiss rounding is never actually used. Is that correct? If it is than what's the point of this method and swiss rounding?

        // this code never dumps anything
        $cbundle = Intl::getCurrencyBundle();
        foreach ($cbundle->getCurrencyNames() as $code => $name) {
            if ($cbundle->getRoundingIncrement($code) !== 0) {
                dump([
                    $code,
                    $cbundle->getRoundingIncrement($code),
                ]);
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.