Open
Conversation
MordaCap
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Originally we had penny set for our sub-unit currency.
Penny -> individual coin
Pence -> sum of pennies
Kind of like cent vs cents.
Since pence was not classified as our unit currency for GBP, phrases like "The total is 50 pound and 60 pence" were not being resolved -> resolving to 50 pound.
I also noticed that penny was resolving on its own correctly, '1 penny' would return '0.01' but when paired with its whole unit '1 pound and 1 penny', it wasn't resolving correctly.
The issue is how we utilise the currencies. Looking at penny and pence, we have a couple of different ISO codes which use these, example GBP, SHP, AKP etc. This is similar for cents.
When we input a phrase like "1 dollar and 1 cent", since we haven't specified an ISO code this gets picked up as
("__D", "CENT")in ourCurrencyFractionMapping. I added the same logic for Pence and Penny so now when paired with Pound Unit it is properly picked up,("__P", "PENNY|PENCE")In the ticket it states,
When a utterance is received with pence when defining an amount of money in GBP, the pence part is ignored, but it will accept just p. However p was not being being properly picked up. As it is commonly used as a sub-unit phrase50pI added it as an abbreviation for pence