Created
February 22, 2017 14:51
-
-
Save maggiben/8551b3c6be3249bf9a450ae4e72a58e7 to your computer and use it in GitHub Desktop.
Get Sup Index Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getNumberSup(number) { | |
const sup = ['⁰','¹', '²', '³','⁴', '⁵', '⁶', '⁷', '⁸', '⁹']; | |
return number.toString().split('').map(x => (sup[parseInt(x)])).join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment