Grammalecte  Diff

Differences From Artifact [d1cf473bd1]:

To Artifact [e53158c191]:


1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341

1342
1343
1344
1345
1346
1347
1348
!!

__[s]/num(num_grand_nombre_soudé)__
    \d\d\d\d+
    <<- not before("NF[  -]?(C|E|P|Q|X|Z|EN(?:[  -]ISO|)) *$") >>>
    <<- \0.__len__() > 4 ->> =formatNumber(\0)                                                      # Formatage des grands nombres.
    <<- __else__
        and after("^(?:,[0-9]+[⁰¹²³⁴⁵⁶⁷⁸⁹]?|[⁰¹²³⁴⁵⁶⁷⁸⁹])")
        or after("^[   ]*(?:[kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰€$£¥Åℓhj]|min|°C|℃)(?![\\w’'])")
    ->> =formatNumber(\0)                                                                           # Formatage des grands nombres.

__[s]/num(num_nombre_quatre_chiffres)__
    (?<!,)(\d\d\d\d)[  ]([a-zA-Zµ][a-zA-Z0-9Ωℓ⁰¹²³⁴⁵⁶⁷⁸⁹/·]*) @@0,$
    <<- morph(\2, ";S", ":[VCR]") or mbUnit(\2) -1>> =formatNumber(\1)                              # Formatage des grands nombres.

TEST: {{12345}}                                 ->> 12 345
TEST: {{123456}}                                ->> 123 456
TEST: {{1234567}}                               ->> 1 234 567
TEST: {{12345678}}                              ->> 12 345 678
TEST: {{023456789}}                             ->> 023 456 789|023 45 67 89|02 345 67 89
TEST: {{0234567890}}                            ->> 0 234 567 890|02 34 56 78 90|023 456 78 90|0234 567-890
TEST: {{12345678901}}                           ->> 12 345 678 901
TEST: {{112798931830912839}}                    ->> 112 798 931 830 912 839
TEST: {{2308393909}}                            ->> 2 308 393 909|2308 393-909
TEST: {{2024}},9                                ->> 2 024
TEST: {{4000}} Å                                ->> 4 000
TEST: {{3240}} µA                               ->> 3 240



__[s>(num_grand_nombre_avec_points)__
    \d\d?\d?(?:[.]\d\d\d)+(?![0-9])
    <<- option("num") ->> =\0.replace(".", " ")                                                     # Grands nombres : utilisez des espaces insécables plutôt que des points.
    <<- ~>> =\0.replace(".", "_")








|
|


















>







1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
!!

__[s]/num(num_grand_nombre_soudé)__
    \d\d\d\d+
    <<- not before("NF[  -]?(C|E|P|Q|X|Z|EN(?:[  -]ISO|)) *$") >>>
    <<- \0.__len__() > 4 ->> =formatNumber(\0)                                                      # Formatage des grands nombres.
    <<- __else__
        and ((after("^(?:,[0-9]+[⁰¹²³⁴⁵⁶⁷⁸⁹]?|[⁰¹²³⁴⁵⁶⁷⁸⁹])") and not (re.search("^[01]+$", \0) and after("^,[01]+\\b")))
        or after("^[   ]*(?:[kcmµn]?(?:[slgJKΩ]|m[²³]?|Wh?|Hz|dB)|[%‰€$£¥Åℓhj]|min|°C|℃)(?![\\w’'])"))
    ->> =formatNumber(\0)                                                                           # Formatage des grands nombres.

__[s]/num(num_nombre_quatre_chiffres)__
    (?<!,)(\d\d\d\d)[  ]([a-zA-Zµ][a-zA-Z0-9Ωℓ⁰¹²³⁴⁵⁶⁷⁸⁹/·]*) @@0,$
    <<- morph(\2, ";S", ":[VCR]") or mbUnit(\2) -1>> =formatNumber(\1)                              # Formatage des grands nombres.

TEST: {{12345}}                                 ->> 12 345
TEST: {{123456}}                                ->> 123 456
TEST: {{1234567}}                               ->> 1 234 567
TEST: {{12345678}}                              ->> 12 345 678
TEST: {{023456789}}                             ->> 023 456 789|023 45 67 89|02 345 67 89
TEST: {{0234567890}}                            ->> 0 234 567 890|02 34 56 78 90|023 456 78 90|0234 567-890
TEST: {{12345678901}}                           ->> 12 345 678 901
TEST: {{112798931830912839}}                    ->> 112 798 931 830 912 839
TEST: {{2308393909}}                            ->> 2 308 393 909|2308 393-909
TEST: {{2024}},9                                ->> 2 024
TEST: {{4000}} Å                                ->> 4 000
TEST: {{3240}} µA                               ->> 3 240
TEST: 1111 0011,01 (binaire)


__[s>(num_grand_nombre_avec_points)__
    \d\d?\d?(?:[.]\d\d\d)+(?![0-9])
    <<- option("num") ->> =\0.replace(".", " ")                                                     # Grands nombres : utilisez des espaces insécables plutôt que des points.
    <<- ~>> =\0.replace(".", "_")