dollars 0.0.1

A simple dollar value in Rust
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 10.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.98 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • a-lafrance/dollars
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • a-lafrance

dollars

A simple dollar value in Rust

Overview

If you need a simple representation of a dollar value backed by a single integer, consider dollars. It doesn't do much, and it doesn't need to.

To get a Dollars value, you can:

  • Construct it directly from an integer cent value
  • Parse it from a string
    • With or without a +/- sign
    • With or without a $ in front
    • With or without a cents portion

Given one, you can:

  • Inspect its component dollar and cent parts
  • Retrieve its value in cents
  • Do basic arithmetic