Skip to main content

Formats numbers in the specified format.

Project description

Plover Number Format

Transforms a previous number in the specified manner. Currently, four actions are supported:

number_format_insert

Formats the previous number in a similar way that Case CATalyst does. Read their guidelines here:

https://www.stenograph.com/content/files/documents/casecatalyst4%20manual.pdf (page 397)

Example:

 "A*PL": "{:number_format_insert:nN:NN} a.m."
 "T*F": "{:number_format_insert:X (XXn) NNN-NNNN}"
 "S*F": "{:number_format_insert:NNN-NN-NNNN}"
 
 248/A*PL
 2:48 a.m.
 
 1259/A*PL
 12:59 a.m.
 
 1234567890/T*F
 (123) 456-7890
 
 3333333/T*F
 333-3333
 
 987654321/S*F
 987-65-4321

number_format_roman

Transforms the previous number into a Roman numeral. There are two arguments:

The first argument specifies the method of conversion. 0: standard; 1: additive.

The second argument specifies the letter case. 0: upper; 1: lower.

Example:

 "R*PB": "{:number_format_roman:0:0}"
 "R*PBS": "{:number_format_roman:1:0}"
 "SR*PB": "{:number_format_roman:0:1}"
 
 2021/R*PB
 MMXXI
 
 19/R*PB
 XIX
 
 19/R*PBS
 XVIIII
 
 19/SR*PB
 xix

number_word_conversion

Converts a previous number to various forms. Accepts cardinal (ex. 12) or ordinal (ex. 12th) numbers, with or without comma separators and/or decimal places, positive or negative. (Does not accept words like "twelve" yet, that's a work in progress.)

Contains two mandatory arguments followed by four optional ones (optional arguments can be arranged in any order):

I. 1: cardinal, 2: ordinal, 0: retain the original form. (ordinal numbers cannot have decimal places)

II. 1: number, 2: word.

III. c1: add comma separators; c2: remove comma separators; c0: retain the original form.

IV. s#: retain # number of significant figures.

V. d#: retain # number of decimal places.

VI. m1: use -(U+002D) as the minus sign; m2: use −(U+2212) as the minus sign; m0: retain the original minus sign

Example:

9223372036854775807 {:number_word_conversion:2:2}
nine quintillion two hundred twenty-three quadrillion three hundred seventy-two trillion thirty-six billion eight hundred fifty-four million seven hundred seventy-five thousand eight hundred seventh

-1,234.567 {:number_word_conversion:0:2}
negative one thousand two hundred thirty-four point five six seven

5th {:number_word_conversion:0:2}
fifth

101st {:number_word_conversion:1:1}
101

2345 {:number_word_conversion:2:1:c1}
2,345th

1234.5678 {:number_word_conversion:2:1:s3:c1}
1,230th

-765.4 {:number_word_conversion:1:1:d3:m2}
−765.400

retro_insert_currency

Inserts a currency symbol (or any symbol, really) in front of the previous number.

Unlike Plover's natively supported command, this command ignores any decimal points, comma separators and any letters or words following the number.

The first argument indicates the number of words to search for. For example, if it is 1, the command will only work if the last word is a number; if it is 10, then the command will affect the most recent number within the previous 10 words.

The second argument is the symbol you want to add in front of that number.

Example:

 "TKHR*": "{:retro_insert_currency:10:$}"
 "TKHR*BG": "{:retro_insert_currency:10:CAD }"
 "P*PBD": "{:retro_insert_currency:10:£}"
 
 1.9 million/TKHR*
 $1.9 million
 
 2,000,000.00/TKHR*BG
 CAD 2,000,000.00
 
 13B bill/P*PBD
 £13B bill

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plover_number_format-1.2.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

plover_number_format-1.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file plover_number_format-1.2.0.tar.gz.

File metadata

  • Download URL: plover_number_format-1.2.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for plover_number_format-1.2.0.tar.gz
Algorithm Hash digest
SHA256 200b079c5d34b41e5aff5d9de85a1fbb5529ffbd58c580c699efbbe2d25696ad
MD5 2b3d9d6fd001494f04bdb8095261cd04
BLAKE2b-256 b9f51f3a0192801bf82b5bdffdf716cd05d7c0ab0a7b2e88920a4189505fb07f

See more details on using hashes here.

File details

Details for the file plover_number_format-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plover_number_format-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c7b044a14fd318097aaf10fefc2486a66eea2744b70342869f300d37bee2881
MD5 957a29819fd43d20dae4b9b7a57658fe
BLAKE2b-256 06672664ae68ff37e11fcfd8f8e86d8068bc17fe7e77afd3cdd4ca89719ab4e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page