Forgot password?
 Create new account
View 134|Reply 0

[MathJax] 长数字分隔符 Decimal separator

[Copy link]

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-9-5 04:58:39 |Read mode
en.wikipedia.org/wiki/Decimal_separator#Digit_grouping
tex.stackexchange.com/questions/110281
在MathJax中,长数字分隔符读号 , 用大括号 {} 括住
  1. $$1{,}411{,}778{,}724$$
Copy the Code
会被识别为一个整体, 生成MathML
  1. <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  2.   <mn>1,411,778,724</mn>
  3. </math>
Copy the Code


  1. $$1,411,778,724$$
Copy the Code

不会被识别为整体, 生成MathML
  1. <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  2.   <mn>1</mn>
  3.   <mo>,</mo>
  4.   <mn>411</mn>
  5.   <mo>,</mo>
  6.   <mn>778</mn>
  7.   <mo>,</mo>
  8.   <mn>724</mn>
  9. </math>
Copy the Code

见源码的正则表达式
$$\verb'/^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/'$$
Screenshot 2022-09-02 at 02-02-12 mspace - MathML MDN.png

手机版Mobile version|Leisure Math Forum

2025-4-20 22:16 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list