File: README.md

package info (click to toggle)
postgresql-numeral 1.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 196 kB
  • sloc: ansic: 370; yacc: 242; sql: 194; lex: 169; makefile: 37; sh: 19
file content (59 lines) | stat: -rw-r--r-- 1,932 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
postgresql-numeral
==================
Christoph Berg <cb@df7cb.de>

**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.

[![Build Status](https://travis-ci.org/df7cb/postgresql-numeral.svg?branch=master)](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.