Function: textsec-mixed-numbers-p

textsec-mixed-numbers-p is a byte-compiled function defined in textsec.el.gz.

Signature

(textsec-mixed-numbers-p STRING)

Documentation

Return non-nil if STRING includes numbers from different decimal systems.

This function examines only characters in STRING whose Unicode general category, as reported by get-char-code-property with its second argument 'general-category, is Decimal_Numbers (Nd). It returns non-nil if it finds numerical characters from different numerical systems. For example, ASCII digit characters and ARABIC-INDIC DIGIT characters belong to different decimal systems.

Source Code

;; Defined in /usr/src/emacs/lisp/international/textsec.el.gz
(defun textsec-mixed-numbers-p (string)
  "Return non-nil if STRING includes numbers from different decimal systems.

This function examines only characters in STRING whose Unicode general
category, as reported by `get-char-code-property' with its second
argument \\='general-category, is Decimal_Numbers (Nd).  It returns
non-nil if it finds numerical characters from different numerical
systems.  For example, ASCII digit characters and ARABIC-INDIC DIGIT
characters belong to different decimal systems."
  (>
   (length
    (seq-uniq
     (mapcar
      (lambda (char)
        ;; Compare zeros in the respective decimal systems.
        (- char (get-char-code-property char 'numeric-value)))
      (seq-filter (lambda (char)
                    ;; We're selecting the characters that
                    ;; have a numeric property.
                    (eq (get-char-code-property char 'general-category)
                        'Nd))
                  string))))
   1))