Skip to content

Commit

Permalink
New Shannon app
Browse files Browse the repository at this point in the history
  • Loading branch information
ToonTalk committed Oct 22, 2024
1 parent 83fa07c commit a7a7dd4
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions apps/number to english o1-mini.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2>Number to English Converter</h2>

// Latin prefixes for scale name construction
const unitsPrefixes = ['', 'Un', 'Duo', 'Tre', 'Quattuor', 'Quin', 'Sex', 'Septen', 'Octo', 'Novem'];
const tensPrefixes = ['', 'Deca', 'Vigint', 'Trigint', 'Quadragint', 'Quinquagint', 'Sexagint', 'Septuagint', 'Octogint', 'Nonagint'];
const tensPrefixes = ['', 'Dec', 'Vigint', 'Trigint', 'Quadragint', 'Quinquagint', 'Sexagint', 'Septuagint', 'Octogint', 'Nonagint'];
const hundredsPrefixes = ['', 'Cent', 'Ducent', 'Trecent', 'Quadringent', 'Quingent', 'Sexcent', 'Septingent', 'Octingent', 'Nongent'];

// Predefined scales up to Decillion for reference
Expand Down Expand Up @@ -100,8 +100,13 @@ <h2>Number to English Converter</h2>
if (hundreds < hundredsPrefixes.length) {
name += hundredsPrefixes[hundreds];
} else {
// Handle cases where hundreds exceed predefined prefixes
name += 'Cent'; // Fallback or custom handling
// For extremely large scales beyond defined hundredsPrefixes
// Repeat 'Cent' for each additional hundred
let extraHundreds = hundreds - (hundredsPrefixes.length - 1);
name += hundredsPrefixes[hundredsPrefixes.length -1];
for(let i = 0; i < extraHundreds; i++) {
name += 'Cent';
}
}
}

Expand All @@ -110,8 +115,13 @@ <h2>Number to English Converter</h2>
if (tensIndex < tensPrefixes.length) {
name += tensPrefixes[tensIndex];
} else {
// Handle cases where tens exceed predefined prefixes
name += 'Deca'; // Fallback or custom handling
// For extremely large scales beyond defined tensPrefixes
// Repeat 'Dec' for each additional ten
let extraTens = tensIndex - (tensPrefixes.length - 1);
name += tensPrefixes[tensPrefixes.length -1];
for(let i = 0; i < extraTens; i++) {
name += 'Dec';
}
}
}

Expand All @@ -120,8 +130,13 @@ <h2>Number to English Converter</h2>
if (unitsDigit < unitsPrefixes.length) {
name += unitsPrefixes[unitsDigit];
} else {
// Handle cases where units exceed predefined prefixes
name += 'Un'; // Fallback or custom handling
// For extremely large scales beyond defined unitsPrefixes
// Repeat 'Un' for each additional unit
let extraUnits = unitsDigit - (unitsPrefixes.length - 1);
name += unitsPrefixes[unitsPrefixes.length -1];
for(let i = 0; i < extraUnits; i++) {
name += 'Un';
}
}
}

Expand Down

0 comments on commit a7a7dd4

Please sign in to comment.