8000 CurrencyBundle::getRoundingIncrement() always retruns 0 · Issue #21247 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
CurrencyBundle::getRoundingIncrement() always retruns 0 #21247
Closed
@enumag

Description

@enumag
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

      0