Commits

Eric Roshan Eisner  committed c0c2e14 Draft

add money unit

  • Participants
  • Parent commits 9690dd9

Comments (0)

Files changed (2)

 			buf = append(buf, 'K')
 		case bytePart:
 			buf = append(buf, 'B')
+		case dollarPart:
+			buf = append(buf, '$')
 		default:
 			return "?"
 		}
 
 	Kelvin:   "K",
 	Byte:     "B",
+	Dollar:   "$",
 	Unitless: "",
 }
 
 	amperePart   = 7
 	kelvinPart   = 11
 	bytePart     = 13
+	dollarPart   = 17
 )
 
 type unit struct {
 	Ampere   = unit{amperePart, 1}
 	Kelvin   = unit{kelvinPart, 1}
 	Byte     = unit{bytePart, 1}
+	Dollar   = unit{dollarPart, 1}
 	Unitless = unit{1, 1}
 
 	Newton    = Kilogram.times(Meter).per(Second).per(Second)