How To Convert A Number To A Roman Numeral In Power Apps
How To Convert A Number To A Roman Numeral In Power Apps Summary This formula will convert a number to a roman numeral in Power Apps. The number must be with...
- Published
- Reading time
- 2 min read
Before you start
Is this guide for you?
- Best entry point
- Power Apps
- Time investment
- 2 min read
Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/how-to-convert-a-number-to-a-roman-numeral-in-power-apps/. Author: Matthew Devaney.
How To Convert A Number To A Roman Numeral In Power Apps Summary
This formula will convert a number to a roman numeral in Power Apps. The number must be within the range of 1-3999. Example Inputs Number 13 Code With( { varNumber : 13 , varRoman : { Units : Table( { val : "I" , key : "1" }, { val : "II" , key : "2" }, { val : "III" , key : "3" }, { val : "IV" , key : "4" }, { val : "V" , key : "5" }, { val : "VI" , key : "6" }, { val : "VII" , key : "7" }, { val : "VIII" , key : "8" }, { val : "IX" , key : "9" } ), Tens : Table( { val : "X" , key : "10" }, { val : "XX" , key : "20" }, { val : "XXX" , key : "30" }, { val : "XL" , key : "40" }, { val : "L" , key : "50" }, { val : "LX" , key : "60" }, { val : "LXX" , key : "70" }, { val : "LXXX" , key : "80" }, { val : "XC" , key : "90" } ), Hundreds : Table( { val : "C" , key : "100" }, { val : "CC" , key : "200" }, { val : "CCC" , key : "300" }, { val : "CD" , key : "400" }, { val : "D" , key : "500" }, { val : "DC" , key : "600" }, { val : "DCC" , key : "700" }, { val : "DCCC" , key : "800" }, { val : "CM" , key : "900" } ), Thousands : Table( { val : "M" , key : "1000" }, { val : "MM" , key : "2000" }, { val : "MMM" , key : "3000" } ) } }, With( {
varThousands : Text(Mod(varNumber, 10000 )-Mod(varNumber, 1000 )),
varHundreds : Text((Mod(varNumber, 1000 )-Mod(varNumber, 100 ))),
varTens : Text((Mod(varNumber, 100 )-Mod(varNumber, 10 ))),
varUnits : Text((Mod(varNumber, 10 ))) }, If( varNumber > 0 And varNumber < 4000 , Concatenate( LookUp(varRoman.Thousands, key=varThousands, val), LookUp(varRoman.Hundreds, key=varHundreds, val), LookUp(varRoman.Tens, key=varTens, val), LookUp(varRoman.Units, key=varUnits, val) ) ) ) ) Code language: JavaScript ( javascript ) Result XIII
Tagged
Power Apps
Have a Microsoft 365 topic idea?
Share article suggestions, community session ideas, corrections, or real-world scenarios for future nxtM365 learning notes.
Keep learning Microsoft 365
Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.
Continue learning
Related tutorials
Related questions
Related comparisons
Next action