accordproject / template-playground

Web Playground for TemplateMark templates
https://playground.accordproject.org
Apache License 2.0
9 stars 18 forks source link

Format numbers as text #9

Open dselman opened 11 months ago

dselman commented 11 months ago

Some clauses include text, such as:

within thirty (30) days for new acquisitions or creations where turnover exceeds GBP 10,000,000 or fifteen percent (15%) of total group turnover declared at inception of this Policy, whichever is the greater;

Where the numeric value and its text representation need to be kept in sync.

A formatting instruction for numbers could be added to covert the number to a locale specific string.

DevanceJ commented 4 months ago

Hey I would like to work on this issue. Also, I'd like to participate in GSOC with the Accord Project, will it improve my chances if I solve a few issues in this repository? Specifically, i'd like to work on this project - https://github.com/accordproject/techdocs/wiki/Google-Summer-of-Code-2024-Ideas-List#1-playground-and-getting-started-experience

ahmad-kashkoush commented 4 months ago

Hi @dselman ,I've explored this repo locally and didn't figure out where should I implement the converter Functions, is the converter logic should be implemented here or in another repo?

dselman commented 4 months ago

The code would be an enhancement to the various "drafters" we have. E.g. here is the one for Integer: https://github.com/accordproject/template-engine/tree/main/src/drafting/Integer

ahmad-kashkoush commented 4 months ago

@dselman It seems that this issue involves adding a formatting method that converts integer, long, and double values to English text. This formatting method gets called based on the format parameter in drafters.

Is my interpretation correct? May I be assigned to this issue?

ahmad-kashkoush commented 4 months ago

@dselman I've created a PR that solve this Issue may I get a Review?