BIS fnc romanNumeral: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.00|Game version=
|1.00


|gr1 = Strings |GROUP1=
|gr1 = Strings


|gr2 = Math |GROUP2=
|gr2 = Math


| Convert integer to roman numeral (e.g. 42 becomes "XLII"). |DESCRIPTION=
| Convert integer to roman numeral (e.g. 42 becomes "XLII").


| integer [[call]] [[BIS_fnc_romanNumeral]] |SYNTAX=
| integer [[call]] [[BIS_fnc_romanNumeral]]


|p1= integer: [[Number]], [[String]], [[Code]] or [[Config]], same as [[BIS_fnc_parseNumber]] (used in this function) - any '''integer''' between 1 and 3999 |parameter 1=
|p1= integer: [[Number]], [[String]], [[Code]] or [[Config]], same as [[BIS_fnc_parseNumber]] (used in this function) - any '''integer''' between 1 and 3999


| [[String]] - Roman number |RETURNVALUE=
| [[String]] - Roman number


|x1= <code>1 [[call]] [[BIS_fnc_romanNumeral]]; {{cc|returns "I"}}</code> |EXAMPLE1=
|x1= <code>1 [[call]] [[BIS_fnc_romanNumeral]]; {{cc|returns "I"}}</code>


|x2= <code>3999 [[call]] [[BIS_fnc_romanNumeral]]; {{cc|returns "MMMCMXCIX"}}</code> |EXAMPLE2=
|x2= <code>3999 [[call]] [[BIS_fnc_romanNumeral]]; {{cc|returns "MMMCMXCIX"}}</code>


| [[BIS_fnc_ordinalNumber]], [[BIS_fnc_phoneticalWord]]|SEEALSO=
| [[BIS_fnc_ordinalNumber]], [[BIS_fnc_phoneticalWord]]
}}
}}



Revision as of 23:47, 17 January 2021

Hover & click on the images for description

Description

Description:
Convert integer to roman numeral (e.g. 42 becomes "XLII").
Execution:
call
Groups:
StringsMath

Syntax

Syntax:
integer call BIS_fnc_romanNumeral
Parameters:
integer: Number, String, Code or Config, same as BIS_fnc_parseNumber (used in this function) - any integer between 1 and 3999
Return Value:
String - Roman number

Examples

Example 1:
1 call BIS_fnc_romanNumeral; // returns "I"
Example 2:
3999 call BIS_fnc_romanNumeral; // returns "MMMCMXCIX"

Additional Information

See also:
BIS_fnc_ordinalNumberBIS_fnc_phoneticalWord

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Bottom Section

Posted on October 1, 2019 - 01:46 (UTC)
Lou Montana
A Roman numeral is read like this:
Numeral I V X L C D M
Value 1 5 10 50 100 500 1000
  • It is read from left to right from the biggest numeral to the lowest*, adding up:
    *: not entirely true, see subtractions below
    • DCLVII = DCLVII = 500 + 100 + 50 + 5 + 1 + 1 = 657
  • A subtraction is done by writing one smaller numeral before a big one:
    • 9 could be written VIIII, or IX = 1 and 10 = 10 - 1 = 9 / but IIX for 8 doesn't exist, only VIII
  • The same numeral can be put together multiple times, but usually (there is no standard, but the shorter version is usually preferred) up to the point where it can be subtracted from the bigger numeral above the used one (subtraction still done with only one numeral):
    • IIII = IV, CCCC = CD


Now let's see if you can translate this one: MCMLXXXV. Tip: where it all started ;-) MCMLXXXII for the purists!
To learn more: Roman numerals on wikipedia