faker
faker copied to clipboard
Add support for generating Roman Numerals
Clear and concise description of the problem
It would be useful to be able to generate roman numerals, e.g. for sections of a fake document, or as a fake pattern to be used in another pattern like "Super Bowl XXVII".
Suggested solution
faker.number.romanNumeral({min:1, max: 100}) //XVII
min would default to 1 (you can't write 0 in roman numerals). max would probably be limited to 4999 as roman numerals are not as well-defined above 5000. Maybe lowercase/uppercase options?
Not localizable. Since roman numerals are always written in latin script.
Alternative
write custom conversion code eg.
convertToRomanNumerals(faker.number.int({min:1, max:4999}))
where convertToRomanNumerals is a suitable implementation from https://stackoverflow.com/questions/9083037/convert-a-number-into-a-roman-numeral-in-javascript
Additional context
No response
Thank you for your feature proposal.
We marked it as "waiting for user interest" for now to gather some feedback from our community:
- If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
- If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.
We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.
We will start the implementation based on:
- the number of votes (:+1:) and comments
- the relevance for the ecosystem
- availability of alternatives and workarounds
- and the complexity of the requested feature
We do this because:
- There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
- Every feature we add to faker has "costs" associated to it:
- initial costs: design, implementation, reviews, documentation
- running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors
Would indeed be interesting at times to have this. I personally see no need for numerals above 4999 or lowercases ones. Min/max is indeed good to have.
Should i implement this feature ?
Should i implement this feature ?
We normally wait until a feature has 10 GitHub upvotes. It's nearly there 😀
@AmaanRS Do you need roman numerals by string length (range) or by value range?