Add Modifier model

This commit is contained in:
2023-04-16 15:52:03 +02:00
parent 6e0b59da4b
commit 7cf5300c3a
4 changed files with 71 additions and 5 deletions

View File

@ -94,5 +94,15 @@ namespace Elwig.Helpers {
public static double OeToKmw(double oe) {
return Math.Round((-4.54 + Math.Sqrt(4.54 * 4.54 - 4 * 0.022 * -oe)) / 2 * 0.022, 1);
}
public static decimal DecFromDb(long value, byte precision) {
bool neg = value < 0;
if (neg) value = -value;
return new decimal((int)(value & 0xFFFFFFFF), (int)((value >> 32) & 0x7FFFFFFF), 0, neg, precision);
}
public static long DecToDb(decimal value, byte precision) {
return (long)decimal.Round(value * precision, 0);
}
}
}