Add support for currency conversion for numerical steno input containing commas #1391
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.
Summary of changes
GOAL
Currency formatting currently only accepts pure digit inputs (3400000 for $3,400,000). Some stenographers write numbers using constructive shortcuts that glue digits with commas included.
THO*U
= {^},000F*UNT
= {^},500,000M*L
= {^},000,000We want to be able to properly format currency amounts when the input is
23,000
the same as23000
.This doesn't work with the currency-formatting macro currently because commas break casting.(https://github.com/openstenoproject/plover/blob/master/plover/meta/currency.py#L11)
APPROACH
last_words
is numerical i.e. is a string that contains at least one number.,
and pass it along as thecast_input
.Closes
This wasn't an official issue to my knowledge.
Pull Request Checklist
(https://github.com/openstenoproject/plover/pull/1391/files#diff-09db2cc1c6dd18f0e430beac98d6e7dd640c7493bf0d412625ff32687cf02a61R758)
https://github.com/openstenoproject/plover/pull/1391/files#diff-51920e95310ebfbc1ae31709f3b95f89afffbf4f1a6e38e8b2b406e2fb6197eaR46