Hacker News new | past | comments | ask | show | jobs | submit login

How do you deal with decimal separator ',' used in a few countries instead of '.'?



Most countries by raw country count.



Less people, by raw population count.


Just for fun (and because I don't like unsourced claims) I fired up Mathematica to sum up the population of the countries listed. Here are the results:

    In[1]:= comma = {"Albania", "Algeria", "Andorra", "Angola", 
       "Argentina", "Armenia", "Austria", "Azerbaijan", "Belarus", 
       "Belgium", "Bolivia", "BosniaHerzegovina", "Brazil", "Bulgaria", 
       "Cameroon", "Canada", "Chile", "Colombia", "CostaRica", "Croatia", 
       "Cuba", "Cyprus", "CzechRepublic", "Denmark", "EastTimor", 
       "Ecuador", "Estonia", "FaroeIslands", "Finland", "France", 
       "Germany", "Georgia", "Greece", "Greenland", "Hungary", "Iceland", 
       "Indonesia", "Italy", "Kazakhstan", "Kosovo", "Kyrgyzstan", 
       "Latvia", "Lebanon", "Lithuania", "Luxembourg", "Macau", 
       "Mauritania", "Moldova", "Mongolia", "Montenegro", "Morocco", 
       "Mozambique", "Namibia", "Netherlands", "Macedonia", "Norway", 
       "Paraguay", "Peru", "Poland", "Portugal", "Romania", "Russia", 
       "Serbia", "Slovakia", "Slovenia", "Somalia", "SouthAfrica", 
       "Spain", "Suriname", "Sweden", "Switzerland", "Tunisia", "Turkey", 
       "Turkmenistan", "Ukraine", "Uruguay", "Uzbekistan", "Venezuela", 
       "Vietnam", "Zimbabwe"};
    
    In[2]:= Plus @@ (Entity["Country", #]["Population"] & /@ comma)
    
    Out[2]= Quantity[1990645326, "People"]
    
    In[3]:= period = {"Australia", "Bangladesh", "Botswana", "Cambodia", 
       "Canada", "China", "DominicanRepublic", "Egypt", "ElSalvador", 
       "Estonia", "Ethiopia", "Ghana", "Guatemala", "Guyana", "Honduras", 
       "HongKong", "India", "Ireland", "Israel", "Jamaica", "Japan", 
       "Jordan", "Kenya", "NorthKorea", "SouthKorea", "Libya", 
       "Liechtenstein", "Luxembourg", "Macau", "Malaysia", "Maldives", 
       "Malta", "Mexico", "Myanmar", "Namibia", "Nepal", "NewZealand", 
       "Nicaragua", "Nigeria", "Pakistan", "Panama", "Peru", 
       "Philippines", "Qatar", "SaudiArabia", "Singapore", "Somalia", 
       "SriLanka", "Switzerland", "Syria", "Taiwan", "Tanzania", 
       "Thailand", "Uganda", "UnitedArabEmirates", "UnitedKingdom", 
       "UnitedStates"};
    
    In[4]:= Plus @@ (Entity["Country", #]["Population"] & /@ period)
    
    Out[4]= Quantity[5210743028, "People"]
It's not accurate because I'm not taking into account things such as "only in French Canada" or "only in currency", so some countries are double counted. But it gives a rough estimate. Five billion people for the dot, two for the comma.


That is really useful information. Thanks!


I felt like I had to add “raw count” even though the OP only mentioned countries since someone would inevitably feel chafed.


Only “chafed” as far as it’s misrepresentative.


This new version has a Convert Number Format command that can be used to convert between the two formats. It just occurred to me I didn't take that into account for the new statistics operations. I'll be sure to fix it.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: