A Current value represents an electrical current in amperes.
Note that since Amperes is defined as Rate Coulombs Seconds (charge
per unit time), you can construct a Current value using Quantity.per:
current =
charge |> Quantity.per durationYou can also do rate-related calculations with Current values to compute
Charge or Duration:
charge =
current |> Quantity.for duration
alsoCharge =
duration |> Quantity.at current
duration =
charge |> Quantity.at_ currentConstruct a current from a number of amperes.
Convert a current to a number of amperes.
Charge.coulombs 10
|> Quantity.per (Duration.seconds 2)
|> Current.inAmperes
--> 5Construct a current from a number of milliamperes.
Current.milliamperes 500
--> Current.amperes 0.5Convert a current to number of milliamperes.
Current.amperes 2 |> Current.inMilliamperes
--> 2000