https://github.com/df7cb/postgresql-numeral
Textual numeric datatypes for PostgreSQL
https://github.com/df7cb/postgresql-numeral
datatype german numeral postgresql roman
Last synced: 6 months ago
JSON representation
Textual numeric datatypes for PostgreSQL
- Host: GitHub
- URL: https://github.com/df7cb/postgresql-numeral
- Owner: df7cb
- Created: 2017-04-01T16:29:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-14T21:36:54.000Z (about 1 year ago)
- Last Synced: 2025-04-14T14:15:19.939Z (6 months ago)
- Topics: datatype, german, numeral, postgresql, roman
- Language: C
- Size: 62.5 KB
- Stars: 9
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
Awesome Lists containing this project
README
postgresql-numeral
==================
Christoph Berg**postgresql-numeral** provides numeric data types for PostgreSQL that use
numerals (words instead of digits) for input and output.Data types:
* *numeral*: English numerals (one, two, three, four, ...), short scale (10⁹ = billion)
* *zahl*: German numerals (eins, zwei, drei, vier, ...), long scale (10⁹ = Milliarde)
* *roman*: Roman numerals (I, II, III, IV, ...)Requires PostgreSQL >= 9.4 (currently up to 13) and Bison 3.
[](https://travis-ci.org/df7cb/postgresql-numeral)
Examples
--------```
# SELECT 'thirty'::numeral + 'twelve'::numeral as sum;
sum
───────────
forty-two# SELECT 'siebzehn'::zahl * 'dreiundzwanzig' AS "Produkt";
Produkt
──────────────────────────
dreihunderteinundneunzig# SELECT 'MCMLV'::roman + 'II'::roman * 'XXX' AS futurum;
futurum
─────────
MMXV
```Implementation
--------------The data types are internally binary compatible to *bigint*. Casts to and from
bigint are defined (to bigint as *implicit*). The module does not implement
any operators but instead reuses the existing bigint operators. Effectively,
the data types behave like bigint, just with different input/output functions.License
-------Copyright (C) 2017, 2020 Christoph Berg
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.