Xqt added a comment.

  Digging deeper in this issue I found out that replacing dot with comma gives 
the expected result:
  
    >>> result = site.parsevalue('quantity', ['1,90e-9+-0,20e-9'], {}, False)
    >>> result
    [{'amount': '+0.00000000190', 'unit': '1', 'upperBound': '+0.00000000210', 
'lowerBound': '+0.00000000170'}]
  
  The uri was 
https://www.wikidata.org/w/api.php?action=wbparsevalue&datatype=quantity&values=1%2C90e-9%2B-0%2C20e-9&options=%7B%7D&maxlag=5&format=json
 but using this directly gives the wrong result too:
  
    {
        "results": [
            {
                "raw": "1,90e-9+-0,20e-9",
                "value": {
                    "amount": "+0.000000190",
                    "unit": "1",
                    "upperBound": "+0.000000210",
                    "lowerBound": "+0.000000170"
                },
                "type": "quantity"
            }
        ]
    }
  
  But where is the trick?

TASK DETAIL
  https://phabricator.wikimedia.org/T312755

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Aklapper, pywikibot-bugs-list, Xqt, Astuthiodit_1, karapayneWMDE, 
Invadibot, Jyoo1011, maantietaja, JohnsonLee01, SHEKH, Dijkstra, ItamarWMDE, 
Khutuck, Akuckartz, Zkhalido, Viztor, Nandana, Wenyi, Lahi, Gq86, 
GoranSMilovanovic, QZanden, Tbscho, MayS, LawExplorer, Mdupont, JJMC89, 
Dvorapa, _jensen, rosalieper, Altostratus, Avicennasis, Scott_WUaS, mys_721tx, 
Wikidata-bugs, aude, jayvdb, Ricordisamoa, Masti, Alchimista, Mbch331
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to