From 2bd20ce4eb25ad437d65c34396257d001a0da23d Mon Sep 17 00:00:00 2001 From: ig Date: Wed, 16 Aug 2023 15:12:23 +0200 Subject: [PATCH] Units: create extensions methods for Int32's --- csharp/Lib/Units/Units.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/csharp/Lib/Units/Units.cs b/csharp/Lib/Units/Units.cs index 50fae56a2..2044d91ae 100644 --- a/csharp/Lib/Units/Units.cs +++ b/csharp/Lib/Units/Units.cs @@ -23,6 +23,19 @@ public static class Units public static Energy Wh (this Double value) => value; public static Percent Percent(this Double value) => value; + public static Current A (this Int32 value) => value; + public static Voltage V (this Int32 value) => value; + public static ActivePower W (this Int32 value) => value; + public static ReactivePower Var (this Int32 value) => value; + public static ApparentPower Va (this Int32 value) => value; + public static Resistance Ohm (this Int32 value) => value; + public static Frequency Hz (this Int32 value) => value; + public static Angle Rad (this Int32 value) => value; + public static Temperature Celsius(this Int32 value) => value; + public static Energy KWh (this Int32 value) => value * 1000; + public static Energy Wh (this Int32 value) => value; + public static Percent Percent(this Int32 value) => value; + public static String ToCsv(this Object thing) { var csvLines = new List();