优化Axis的数值Label的默认显示格式

This commit is contained in:
monitor1394
2023-02-10 13:23:38 +08:00
parent d6630ef5bf
commit 80d9087084
7 changed files with 69 additions and 65 deletions

View File

@@ -782,19 +782,7 @@ namespace XCharts.Runtime
return min;
}
public static int GetFloatAccuracy(double value)
{
if (value > 1 || value < -1) return 0;
int count = 1;
int intvalue = (int) (value * Mathf.Pow(10, count));
while (intvalue == 0 && count < 38)
{
count++;
intvalue = (int) (value * Mathf.Pow(10, count));
}
if (count == 38 && (value == 0 || value == 1)) return 1;
else return count;
}
public static void AddEventListener(GameObject obj, EventTriggerType type,
UnityEngine.Events.UnityAction<BaseEventData> call)