title: How to set a custom thousands separator?
body: <p>I know that theoretically digits in large integers can be grouped by thousands for better readability:</p>
  
  <pre><code>Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
  [GCC 5.4.0 20160609] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import locale
  &gt;&gt;&gt; locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
  'en_US.UTF-8'
  &gt;&gt;&gt; locale.format('%d', 1234567890, grouping=True)
  '1,234,567,890'
  &gt;&gt;&gt; "{:n}".format(1234567890)
  '1,234,567,890'
  </code></pre>
  
  <p>However, surprisingly, this won’t work for every locale:</p>
  
  <pre><code>&gt;&gt;&gt; locale.setlocale(locale.LC_ALL, 'pl_PL.UTF-8')
  'pl_PL.UTF-8'
  &gt;&gt;&gt; locale.format('%d', 1234567890, grouping=True)
  '1234567890'
  &gt;&gt;&gt; "{:n}".format(1234567890)
  '1234567890'
  </code></pre>
  
  <p>Why are numbers not formatted? I find this strange. I would expect something like <code>1 234 567 890</code> being printed.</p>
  
  <p>Per <a href="https://docs.python.org/library/string.html#format-specification-mini-language" rel="nofollow noreferrer">Format Specification Mini-Language</a>, we can explicitly enforce two possible separators: a comma <code>,</code> and an underscore <code>_</code>. Sadly, a comma is inappropriate for Polish since it is used as a decimal point separator there, and a number like <code>1_234_567_890</code> would look oddly for most people.</p>
  
  <p>Can we somehow enforce a non-breaking space <code></code> being used as a thousands separator?</p>