29 lines
697 B
C#
29 lines
697 B
C#
namespace CommonMessurementUnits
|
|
{
|
|
using CommonMessurementUnits.JsonConverters;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
[JsonConverter(typeof(CurrentConverter))]
|
|
public class Current : Base
|
|
{
|
|
public double MiliampereHours
|
|
{
|
|
get => this.AmpereHours * MAInH;
|
|
set => this.AmpereHours = value / MAInH;
|
|
}
|
|
|
|
public double AmpereHours
|
|
{
|
|
get => this.value;
|
|
set => this.value = value;
|
|
}
|
|
|
|
public static implicit operator Current(double x)
|
|
=> new Current { value = x };
|
|
|
|
public static implicit operator Current(double? x)
|
|
=> new Current { value = x ?? 0 };
|
|
}
|
|
}
|