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

Large numbers #40

Open
marcortola opened this issue Jun 19, 2018 · 3 comments
Open

Large numbers #40

marcortola opened this issue Jun 19, 2018 · 3 comments

Comments

@marcortola
Copy link

marcortola commented Jun 19, 2018

There may be cases where a large arabic number needs to be converted to a roman number. Should we implement that? I have read about Vinculum system as it seems to be the most widely used.

It should be viable to implement it for handling numbers between the [4000,3999999] range. I have done a quick (and ugly 😄) patch in order to filter the generated number (note that I have only implemented the arabic to roman conversion):

if (4000 <= $this->arabicNumeral && 3999999 >= $this->arabicNumeral) {
    return sprintf(
        '<span class="overline">%s</span>%s',
        str_replace('N', '', (new IntToRoman())->filter(intval(substr($this->arabicNumeral, 0, -3)))),
        str_replace('N', '', (new IntToRoman())->filter(intval(substr($this->arabicNumeral, -3))))
    );
} else {
    return (new IntToRoman())->filter($this->arabicNumeral);
}
@wandersonwhcr
Copy link
Owner

Sorry, I'm trying to update my package and only now I found this!

Thinking about it, we have UTF-8.

https://en.wikipedia.org/wiki/Numerals_in_Unicode#Roman_numerals

:)

@wandersonwhcr
Copy link
Owner

We can check this source, too.

https://www.unicode.org/charts/PDF/U2150.pdf

@wandersonwhcr wandersonwhcr added this to the v1.4 Nero milestone Apr 10, 2021
@wandersonwhcr
Copy link
Owner

wandersonwhcr commented Apr 10, 2021

If we will use Unicode definition, I think we must use only Archaic numerals.

And we must add an option to turn on this usage, like $this->automaton->useArchaic().

@wandersonwhcr wandersonwhcr modified the milestones: v1.4 Nero, v1.5 Galba Aug 4, 2021
@wandersonwhcr wandersonwhcr modified the milestones: v1.5 Galba, v1.6 Otho Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants