Display
Data used to set display and formatting preferences for Dynamo UI
using Autodesk.DesignScript.Runtime;
using System;
using System.Linq;
namespace DynamoUnits
{
[Obsolete("This type will be removed in Dynamo 3.0, please use PreferenceSettings.NumberFormat instead. ")]
[IsVisibleInDynamoLibrary(false)]
public class Display
{
[IsVisibleInDynamoLibrary(false)]
public enum NumberFormat
{
Decimal,
Fraction
}
[IsVisibleInDynamoLibrary(false)]
public static string PrecisionFormat { get; set; } = "f4";
[IsVisibleInDynamoLibrary(false)]
public static int Precision {
get {
return Convert.ToInt16(PrecisionFormat.ToCharArray().Last().ToString());
}
}
[IsVisibleInDynamoLibrary(false)]
public static NumberFormat UnitNumberFormat { get; set; } = NumberFormat.Decimal;
[IsVisibleInDynamoLibrary(false)]
public static bool RemoveTrailingZeros { get; set; } = true;
}
}