0

I was reading the docs to understand the unicodedata but I am confused between the unicodedata.digit() and unicodedata.decimal().

They are both similar to me and even return the same results. Can you please explain it a little.

I looked down the pyi file for both the method and they even share the same signature.

import unicodedata
unicodedata.decimal(u"5",'notfound')
unicodedata.digit(u'5','notfound')
AlixaProDev
  • 472
  • 1
  • 5
  • 13
  • The accepted answer on the linked question has a thorough discussion (with references) on the differences between `decimal` and `digit`. – larsks Mar 07 '22 at 18:25
  • 2
    I can not see a discussion between the decimal and digit it was the difference between the numeric and decimal. I gone through the whole discussion and yet not understand what was the difference between the digit and decimal. THough I have get the information between the numeric and digit. – AlixaProDev Mar 07 '22 at 18:33
  • 1
    You might have to look up the definitions of "digit" and "decimal" in the Unicode specs. Some quick tests indicate that the scope of "decimal" is narrower than that of "digit", eg. the subscript digit `"₂"` is covered by `.digit()` but not `.decimal()`. – lenz Mar 07 '22 at 19:30

0 Answers0