Skip to content
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

Make "hybrid" money text format #56

Open
mikekaganski opened this issue Jun 4, 2019 · 1 comment
Open

Make "hybrid" money text format #56

mikekaganski opened this issue Jun 4, 2019 · 1 comment

Comments

@mikekaganski
Copy link
Contributor

Hi!

I'm having trouble creating a rule for Russian money format required by our gvmt: for 1234.56, it must return "one thousand two hundred thirty-three roubles 54 kopecks" - note the number of kopecks is not in text. Could you please advise?

@laszlonemeth
Copy link
Contributor

The English module contains a similar alternative version called "money":

"money USD 1234.56" results "one thousand two hundred thirty-four and 56/100 U.S. dollars"

inserting the cents (4th regex group) without conversion using \4:

no cents

"([A-Z]{3}) ([-−]?1)" $2$(\1:us)
"([A-Z]{3}) ([-−]?\d+)" $2$(\1:up)

with cents

"(([A-Z]{3}) ([-−]?\d+)).," $3 and 1/100$(\2:us)
"(([A-Z]{3}) ([-−]?\d+)).," $3 and \40/100$(\2:up)
"(([A-Z]{3}) ([-−]?\d+)).," $3 and \4/100$(\2:up)
"(([A-Z]{3}) ([-−]?\d+)).," $3 and \4/1000$(\2:up)

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

No branches or pull requests

2 participants