Skip to content

Improve Serbian Dinar formatting - #1124

Merged
yukideluxe merged 5 commits into
RubyMoney:mainfrom
s-mage:main
Jul 9, 2025
Merged

Improve Serbian Dinar formatting#1124
yukideluxe merged 5 commits into
RubyMoney:mainfrom
s-mage:main

Conversation

@s-mage

@s-mage s-mage commented Mar 22, 2025

Copy link
Copy Markdown
Contributor

Hey, thanks for the gem!

I noticed that you want to move to the formatting based on locale by default, and it's a good thing. You still want to support formatting based on the currency, so I thought I'd fix that for RSD.

So, basically the currency formatting is number formatting, currency symbol, and if we want to put the symbol before or after the currency.

Number formatting guidelines are easy to find. Two from the first page of google:

This gives us decimal mark , and separator . (though space is a valid separator as well).

The internet agrees that the symbol should be placed after the number:

Screenshot 2025-03-22 at 14 05 15

As for the symbol, I couldn't be sure and had to find an authority. Found two, Unicode CLDR (that ECMA 402 spec for internationalization API mentions) and my Serbian teacher Borislava who is also a philologist. I also wrote an email to the Institute or Serbian Language, but it's protesting at the moment and won't reply. What's better, Borislava and Unicode agree that your best bet on the symbol is RSD. If the rest of the text is in Serbian and is cyrillic, you will probably be better off using РСД but RSD is still fine since it's also the ISO code, while РСД in latin is wrong.

There is also the amount of digits after the decimal mark. It's correct here and incorrect in the Unicode repo. I wrote to People's bank of Serbia to be sure, they replied (for a change) and yes, there are no coins for Para but they are still used for cashless operations.

All in all, RSD currency-based formatting should be

12.345,42 RSD

This PR changes the currency_iso dataset to make it so.

> Money.locale_backend = :currency
=> :currency
> Money.from_amount(12345.42, "RSD").format
=> "12.345,42 RSD"

Thanks!

@mooncitydev mooncitydev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSD stands for

@sunny sunny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a small entry to the Changelog as well? 🙏🏻

@s-mage

s-mage commented Jun 26, 2025

Copy link
Copy Markdown
Contributor Author

@sunny sure, done

@yukideluxe

Copy link
Copy Markdown
Member

@s-mage if you resolve the conflicts we can get this sorted out 😊

@s-mage

s-mage commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

@yukideluxe sure thing, done now

@yukideluxe yukideluxe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@yukideluxe
yukideluxe merged commit 815098f into RubyMoney:main Jul 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants