v1.0.1
The README file was showing *very* out-of-date information. The README now shows proper documentation, with everything being consistent.
This commit is contained in:
parent
90a3f41c2d
commit
86b0698ca9
2 changed files with 69 additions and 47 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sterling"
|
name = "sterling"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
description = "Converts a given D&D 5e currency value to the Silver Standard."
|
description = "Converts a given D&D 5e currency value to the Silver Standard."
|
||||||
authors = ["Zachary Dziura <zcdziura@gmail.com>"]
|
authors = ["Zachary Dziura <zcdziura@gmail.com>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
114
README.md
114
README.md
|
@ -1,8 +1,10 @@
|
||||||
# Sterling
|
# Sterling
|
||||||
|
|
||||||
Converts a given D&D 5e currency value to the Silver Standard. Inspired by the Reddit posts titled
|
Converts a given D&D 5e currency value to the Silver Standard. Inspired by the
|
||||||
[The Silver Hack: Making Money Matter](https://www.reddit.com/r/DnDBehindTheScreen/comments/80f6kt/the_silver_hack_making_money_matter/),
|
Reddit posts titled [The Silver Hack: Making Money
|
||||||
and [I make Silver Standard for 5th Edition (Spreadsheets.)](https://www.reddit.com/r/dndnext/comments/5tt5g8/i_make_silver_standard_for_5_edition_spreadsheets/).
|
Matter](https://www.reddit.com/r/DnDBehindTheScreen/comments/80f6kt/the_silver_hack_making_money_matter/),
|
||||||
|
and [I make Silver Standard for 5th Edition
|
||||||
|
(Spreadsheets.)](https://www.reddit.com/r/dndnext/comments/5tt5g8/i_make_silver_standard_for_5_edition_spreadsheets/).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -11,8 +13,8 @@ USAGE:
|
||||||
sterling [FLAGS] [OPTIONS] [VALUE]... [SUBCOMMAND]
|
sterling [FLAGS] [OPTIONS] [VALUE]... [SUBCOMMAND]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-o, --optional Include currencies marked as optional when converting.
|
-o, --optional Include currencies marked as optional when converting
|
||||||
-f, --full Print currencies with full name, rather than with alias.
|
-f, --full Print currencies with their full name, rather than with their alias
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
-V, --version Prints version information
|
-V, --version Prints version information
|
||||||
|
|
||||||
|
@ -24,9 +26,12 @@ ARGS:
|
||||||
e, s, or c.
|
e, s, or c.
|
||||||
|
|
||||||
SUBCOMMANDS:
|
SUBCOMMANDS:
|
||||||
add Add two currency amounts together; uses the currencies defined in your config file
|
add Add two currency amounts together; uses the currencies defined in your config file
|
||||||
help Prints this message or the help of the given subcommand(s)
|
copper Calculate the copper value of a custom currency
|
||||||
sub Subtract two currency amounts from one another; uses the currencies defined in your config file
|
div Divide a currency amount by some scalar divisor; uses the currencies defined in your config file
|
||||||
|
help Prints this message or the help of the given subcommand(s)
|
||||||
|
mul Multiply a scalar multiplicand by a currency amount; uses the currencies defined in your config file
|
||||||
|
sub Subtract two currency amounts from one another; uses the currencies defined in your config file
|
||||||
```
|
```
|
||||||
|
|
||||||
## Converting Currency Examples
|
## Converting Currency Examples
|
||||||
|
@ -36,14 +41,14 @@ SUBCOMMANDS:
|
||||||
sterling 100p // 10g
|
sterling 100p // 10g
|
||||||
|
|
||||||
// Convert one hundred platinum, fifty gold coins:
|
// Convert one hundred platinum, fifty gold coins:
|
||||||
sterling 100p 50g // 10g, 5s
|
sterling 100p 50g // 10g, 50s
|
||||||
|
|
||||||
// Convert fifteen thousand copper coins, printing the full names of the coins:
|
// Convert fifteen thousand copper coins, printing the full names of the coins:
|
||||||
sterling -f 15000c // 1 gold, 50 silver
|
sterling -f 15000c // 1 gold, 50 silvers
|
||||||
|
|
||||||
// Convert one platinum, thirty-six gold, twelve electrum, eighty-two silver, and four hundred
|
// Convert one platinum, thirty-six gold, twelve electrum, eighty-two silver, and four hundred
|
||||||
// sixty-nine copper coins, printing the full names of the coins
|
// sixty-nine copper coins, printing the full names of the coins
|
||||||
sterling --full 1p 36g 12e 82s 469c // 64 silver, 89 copper
|
sterling --full 1p 36g 12e 82s 469c // 64 silvers, 89 coppers
|
||||||
|
|
||||||
// Convert one platinum, thirty-six gold, twelve electrum, eighty-two silver, and four hundred
|
// Convert one platinum, thirty-six gold, twelve electrum, eighty-two silver, and four hundred
|
||||||
// sixty-nine copper coins, printing the full names of the coins, using the custom config file
|
// sixty-nine copper coins, printing the full names of the coins, using the custom config file
|
||||||
|
@ -51,32 +56,44 @@ sterling --full 1p 36g 12e 82s 469c // 64 silver, 89 copper
|
||||||
sterling --full -o -c "~/Documents/D&D/sterling-conf.yml" 1p 36g 12e 82s 469c // 7 guilders, 6 sterling, 25 pence
|
sterling --full -o -c "~/Documents/D&D/sterling-conf.yml" 1p 36g 12e 82s 469c // 7 guilders, 6 sterling, 25 pence
|
||||||
```
|
```
|
||||||
|
|
||||||
## Adding and Subtracting Currency Examples
|
## Subcommand Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
// Add together ten and twenty pense, using the custom config file detailed below
|
// Add together ten and twenty pense, using the custom config file detailed below
|
||||||
sterling add "10p" "20p" // 30p
|
sterling add "10p" "20p" // 30p
|
||||||
|
|
||||||
// Subtract two sterling and ten pence from one florin
|
// Subtract two sterling and ten pence from one eagle
|
||||||
sterling sub "1F" "2s 10p" --full // 2 sterling, 10 pence
|
sterling --full sub "1e" "2s 10p" // 19 guilders, 25 sterling, 22 pence
|
||||||
|
|
||||||
// Subtract one florin from two sterling and ten pence. Note that, regardless of order, the smaller
|
// Subtract one eagle from two sterling and ten pence. Note that, regardless of order, the smaller
|
||||||
// value is ALWAYS subtracted from the larger value.
|
// value is ALWAYS subtracted from the larger value.
|
||||||
sterling sub "2s 10p" "1F" --full // 2 sterling, 10 pence
|
sterling --full sub "2s 10p" "1F" // 19 guilders, 25 sterling, 22 pence
|
||||||
|
|
||||||
|
// Multiply two sterling and ten pence by thirteen. Note that the currencies always go after the
|
||||||
|
// multiplier.
|
||||||
|
sterling --full mul 13 2s 10p // 1 guilder, 2 sterling, 2 pence
|
||||||
|
|
||||||
|
// Divide one guilder, 2 sterling, and 2 pence by thirteen.
|
||||||
|
sterling --full div 13 1g 2s 2p // 2 sterling, 10 pence
|
||||||
|
|
||||||
|
// Convert one note, three eagles, and five guilders into copper
|
||||||
|
sterling copper 1N 3e 5g // 201,600c
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that `sterling` doesn't allow for negative currencies. Therefore, when subtracting currencies,
|
Note that `sterling` doesn't allow for negative currencies. Therefore, when
|
||||||
the smaller currency value will always be subtracted from the larger currency value, regardless of
|
subtracting currencies, the smaller currency value will always be subtracted
|
||||||
the order of the currencies in the `sub` command.
|
from the larger currency value, regardless of the order of the currencies in the
|
||||||
|
`sub` command.
|
||||||
|
|
||||||
## Custom Currencies
|
## Custom Currencies
|
||||||
|
|
||||||
`sterling` allows for user-defined currencies, with their own names and conversion rates. By
|
`sterling` allows for user-defined currencies, with their own names and
|
||||||
default, `sterling` will look at a file within the current directory called `sterling-conf.yml`, or
|
conversion rates. By default, `sterling` will look at a file within the current
|
||||||
in whatever location as supplied by the `-c` flag. You can also specify that a currency be optional,
|
directory called `sterling-conf.yml`, or in whatever location as supplied by the
|
||||||
which will prevent that currency from being used when converting values, unless the `-o` flag is
|
`-c` flag. You can also specify that a currency be optional, which will prevent
|
||||||
passed. Below is an example `sterling-conf.yml` file, showing the actual currencies that I use
|
that currency from being used when converting values, unless the `-o` flag is
|
||||||
within my own campaign!
|
passed. Below is an example `sterling-conf.yml` file, showing the actual
|
||||||
|
currencies that I use within my own campaign!
|
||||||
|
|
||||||
```
|
```
|
||||||
-
|
-
|
||||||
|
@ -104,38 +121,43 @@ within my own campaign!
|
||||||
plural: "pence"
|
plural: "pence"
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that the `rate` value is defined as the number of copper coins that goes into one of
|
Please note that the `rate` value is defined as the number of copper coins that
|
||||||
that particular currency. In the example above, twelve copper coins goes into one "penny", and
|
goes into one of that particular currency. In the example above, thirty-two
|
||||||
two-hundred forty copper coins goes into one "sterling".
|
copper coins goes into one "shilling", and eight-hundred ninety-siz copper coins
|
||||||
|
goes into one "guilder".
|
||||||
|
|
||||||
## Abstract
|
## Abstract
|
||||||
|
|
||||||
Items and expenses are, by default, assigned arbitrary currency values within the official D&D 5th
|
Items and expenses are, by default, assigned arbitrary currency values within
|
||||||
edition source books. Many of the officially priced items use the "Gold Standard"; that is, items
|
the official D&D 5th edition source books. Many of the officially priced items
|
||||||
are priced in gold coins by default. While there is nothing wrong with using official currency
|
use the "Gold Standard"; that is, items are priced in gold coins by default.
|
||||||
values within your campaign, it leads to the perceived value of gold to be less in the eyes of your
|
While there is nothing wrong with using official currency values within your
|
||||||
players. Gold has been sought after as both a commodity and a currency for centuries, and your
|
campaign, it leads to the perceived value of gold to be less in the eyes of your
|
||||||
campaign aught to treat gold similarly!
|
players. Gold has been sought after as both a commodity and a currency for
|
||||||
|
centuries, and your campaign aught to treat gold similarly!
|
||||||
|
|
||||||
## Explanation
|
## Explanation
|
||||||
|
|
||||||
The basis of the Silver Standard treats one gold coin from the official D&D 5e source books as one
|
The basis of the Silver Standard treats one gold coin from the official D&D 5e
|
||||||
silver coin, and that there are one hundred of a given coin to every one of the next highest valued
|
source books as one silver coin, and that there are one hundred of a given coin
|
||||||
coin. That's all. Thus, one hundred fifty copper coins equals one silver and fifty copper coins,
|
to every one of the next highest valued coin. That's all. Thus, one hundred
|
||||||
while a suit of heavy plate armor equals fifteen gold coins, rather than fifteen hundred.
|
fifty copper coins equals one silver and fifty copper coins, while a suit of
|
||||||
|
heavy plate armor equals fifteen gold coins, rather than fifteen hundred.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
The easiest way to install `sterling` is to do so with `cargo`, the build tool that's installed
|
The easiest way to install `sterling` is to do so with `cargo`, the build tool
|
||||||
along with the `rust` compiler. If you already have `rust` and `cargo` installed onto your computer,
|
that's installed along with the `rust` compiler. If you already have `rust` and
|
||||||
simply run the following command from a command prompt:
|
`cargo` installed onto your computer, simply run the following command from a
|
||||||
|
command prompt:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cargo install sterling
|
$ cargo install sterling
|
||||||
```
|
```
|
||||||
|
|
||||||
If you do not have the `rust` compiler installed, you can also find pre-built binaries for 64-bit
|
If you do not have the `rust` compiler installed, you can also find pre-built
|
||||||
Windows, macOS, and Linux computers in the "Tags" navigation link, which is displayed above this
|
binaries for 64-bit Windows, macOS, and Linux computers in the "Tags" navigation
|
||||||
README. Simply download the correct binary for your computer's operating system, extract it
|
link, which is displayed above this README. Simply download the correct binary
|
||||||
somewhere into your file system (such as a "bin" folder within your user directory), and add that
|
for your computer's operating system, extract it somewhere into your file system
|
||||||
location to your system's PATH.
|
(such as a "bin" folder within your user directory), and add that location to
|
||||||
|
your system's PATH.
|
Loading…
Add table
Reference in a new issue