numeral

numeral

numeral : numeral datatypes extension

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3710
numeral
numeral
1.3
TYPE
GPL-2.0
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-r
No
Yes
No
Yes
yes
no
Relationships
See Also
currency
pgmp
unit
prefix
semver
pgpdf
pglite_fusion
md5hash

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
MIXED
1.3
18
17
16
15
14
numeral-
RPM
PIGSTY
1.3
18
17
16
15
14
numeral_$v-
DEB
PGDG
1.3
18
17
16
15
14
postgresql-$v-numeral-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el8.aarch64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el9.x86_64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el9.aarch64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el10.x86_64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el10.aarch64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
d12.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
d12.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
d13.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
d13.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u22.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u22.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u24.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u24.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3

Source

pig build pkg numeral;		# build rpm

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install numeral;		# install via package name, for the active PG version

pig install numeral -v 18;   # install for PG 18
pig install numeral -v 17;   # install for PG 17
pig install numeral -v 16;   # install for PG 16
pig install numeral -v 15;   # install for PG 15
pig install numeral -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION numeral;

Usage

numeral: text numeral data types (English, German, Roman)

The numeral extension provides three custom numeric data types that use textual numerals instead of digits.

CREATE EXTENSION numeral;

Data Types

  • numeral: English numerals using short scale (10^9 = billion)
  • zahl: German numerals using long scale (10^9 = Milliarde)
  • roman: Roman numerals

All three are internally binary-compatible with bigint and implicitly cast to it.

Examples

-- English numerals
SELECT 'thirty'::numeral + 'twelve'::numeral;
-- forty-two

-- German numerals
SELECT 'siebzehn'::zahl * 'dreiundzwanzig'::zahl;
-- dreihunderteinundneunzig

-- Roman numerals
SELECT 'MCMLV'::roman + 'II'::roman * 'XXX'::roman;
-- MMXV

Operators

Standard arithmetic operators (+, -, *, /) work through the implicit bigint cast. All existing bigint operators and functions are available.

Last updated on