At some point in school, we South Africans are told that the official decimal separator is the comma.1 Most of us then proceed to ignore this—at least in English use2—because it differs from the decimal point used in the rest of the English-speaking world, and thereby creates confusion. Thankfully, the maintainers of the glibc locale data—and thus the number formats used in Linux systems—agree with me on this question, and the South African English locale uses the decimal point.
Unfortunately, the developers of Ubuntu Linux have come across a government communications style guide—a style guide widely ignored even within the government—which specifies the use of the decimal comma. They have therefore included in Ubuntu a patch which changes the decimal separator for South African English to a comma.3 Reversing this change is one of the first things I do after setting up a new Ubuntu (or Linux Mint) install. Fortunately it is quite easy, and I give the instructions here to help those who suffer from the same annoyance.
Run the command
sudo update-locale LC_NUMERIC="en_GB.UTF-8"
The change won't take effect until you log out and back in again. This tells your system to use the British English settings for number formatting, and therefore to use the decimal point.
(If, for some reason, update-locale doesn't work for you, you can produce the same results by adding the line LC_NUMERIC="en_GB.UTF-8" to the file /etc/default/locale.)
This method changes LC_NUMERIC which defines the format for ordinary numbers, but not LC_MONETARY, which defines the format for currency values. We could change LC_MONETARY to "en_GB.UTF-8", but then it would also change the currency symbol from "R" to "£".
If we want to change the decimal separator for monetary values, without changing the currency symbol, we will have to edit the en_ZA locale definitions. You can download my patch file en_ZA-decimal-point.patch, and then apply it to the locale definitions by running the commands
sudo patch /usr/share/i18n/locales/en_ZA en_ZA-decimal-point.patch
The changes will take effect immediately. You may have to repeat this process if the locales package is upgraded, because the upgrade will overwrite the locale definitions.
I've drawn some maps showing the percentage-point change between the 2009 and 2014 elections in the vote share of the major parties (or, in the case of COPE, formerly major parties). Because municipal boundaries have changed a bit, I had to recalculate the 2009 results for the 2014 boundaries, by assigning the voting districts from 2009 to wards from 2014. In the cases where a 2009 VD was spread across multiple 2014 municipalities, I assigned it according to the location of the voting station.
As always, click on the map to see the full-size version.
The ANC has increased its share substantially in some parts of the Western and Northern Cape; but it appears to have been at the cost of COPE or other smaller opposition parties, as the DA has also seen an increase in most of these areas (see the next map).
Some of the substantial increases seen by the DA are thanks to its absorption of the Independent Democrats.
Since the EFF is a new party the map just shows its share of the vote in 2014. The municipality where it won more than 20% is, unsurprisingly, Rustenburg, where it won 20.22% of the vote.
Essentially, this map just shows COPE's share of the vote in 2009. In the places where it won more votes in 2009, it had more votes to lose in 2014.
The IFP lost badly in northern KZN, shedding votes to the breakaway NFP and, to a lesser extent, the ANC.
The NFP, which broke away from the IFP before the 2011 municipal elections, managed to win a substantial share of the vote in northern KZN.
The detailed 2014 election results map promised in my last post is live! It has all the features of the 2009 map, plus you can see the results from both the national and the provincial ballots. As before, you can zoom right down to street level and see the results for individual voting districts.
By way of example, here you can see it with the provincial ballot results from my voting station.
As a long-weekend project I've put together this interactive map of the 2009 South African election results. It's a "slippy" (i.e. scrollable and zoomable) map and you can zoom right down to street level and see the results for individual voting districts. (Something you can't do with the News24 election map!)
Use the buttons in the top left to choose the level of detail—province, district municipality, local municipality, ward or voting district—though wards and voting districts aren't available until you zoom in a few levels. Click on an area on the map to see the results for that area. For example, here are the results from my voting district in Rosebank.
It's my plan to have a version with the 2014 election results up as soon as possible after the IEC releases the detailed results spreadsheets once the election is declared.
I have a new site up which graphically displays information about the results of the 2009 South African elections. This project was an exercise in learning to use the D3.js framework. All the code and data is available in a github repository.
For comparison with the 2011 census maps in my previous blog post, I've drawn similar maps based on the 2001 census data. There are two caveats to this: firstly, the 2001 census only made the race data available at a subplace (i.e. suburb) level, although the density is accurate to similar levels as the 2011 maps. Secondly, the 2001 census did not include the response of "Other" to the race question.
Here's Cape Town (2001 first and 2011 second; as before, click for full-size):
My next long-term project is to turn this type of data into an overlay for Google Maps/OpenStreetMap so that you can scroll around and see how this looks across the whole country.