dollars

Crates.iodollars
lib.rsdollars
version0.0.1
sourcesrc
created_at2024-06-19 08:55:40.127324
updated_at2024-06-19 08:55:40.127324
descriptionA simple dollar value in Rust
homepage
repositoryhttps://github.com/a-lafrance/dollars
max_upload_size
id1276670
size9,217
Arthur Lafrance (a-lafrance)

documentation

README

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
Commit count: 3

cargo fmt