Uses Babel to add some localisation features to Datasette.
- Render formatted cell-values, e.g. 1234567 > 1 234 567 and 1234567 > 1 234 567,00 kr
- Filters for Ninja2 to show localized numbers.
- Custom SQL functions.
Install this plugin in the same environment as Datasette.
datasette install datasette-localized-numbers
(sv_SE only!)
{{ value|localized_number }}
{{ value|localized_currency }}
(sv_SE only!)
SELECT(localized_number(1234567))
Result: "1 234 567"
SELECT(localized_currency(1234567))
Result: "1 234 567,00 kr"
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-localized-numbers
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest