数据添加单位显示

This commit is contained in:
xy
2024-08-16 18:19:49 +08:00
parent e6e3ae958b
commit 2f1252fbce
3 changed files with 68 additions and 48 deletions

View File

@@ -0,0 +1,26 @@
package com.njcn.csdevice.utils;
/**
* 类的介绍:用来将二次值转成一次值
* @author xuyang
* @version 1.0.0
*/
public class DataChangeUtil {
public static double secondaryToPrimary(String formula, Double data,Double pt, Double ct) {
switch (formula) {
case "*PT":
data = data * pt;
break;
case "*CT":
data = data * ct;
break;
case "*PT*CT":
data = data * pt * ct;
break;
default:
break;
}
return data;
}
}