Skip to content

Instantly share code, notes, and snippets.

@ArneS
Created May 13, 2015 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArneS/2ecfbe4a9d7072ac56c0 to your computer and use it in GitHub Desktop.
Save ArneS/2ecfbe4a9d7072ac56c0 to your computer and use it in GitHub Desktop.
Javascript function to return unicode superscript digits. Handy for writing on html canvas
function digitToUnicodeSupercriptDigit(n) {
subst = [176,185,178,179,0x2074,0x2075,0x2076,0x2077,0x2078,0x2079]
return String.fromCharCode(subst[n]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment