Ejemplo n.º 1
0
        private string BuildString(DynamoAreaUnit unit)
        {
            switch (unit)
            {
                case DynamoAreaUnit.SquareMillimeter:
                    return (_value*SIUnit.ToSquareMillimeters).ToString("0.00", CultureInfo.InvariantCulture) + " mm²";

                case DynamoAreaUnit.SquareCentimeter:
                    return (_value*SIUnit.ToSquareCentimeters).ToString("0.00", CultureInfo.InvariantCulture) + " cm²";

                case DynamoAreaUnit.SquareMeter:
                    return _value.ToString("0.00", CultureInfo.InvariantCulture) + " m²";

                case DynamoAreaUnit.SquareInch:
                    return (_value*SIUnit.ToSquareInch).ToString("0.00", CultureInfo.InvariantCulture) + " in²";

                case DynamoAreaUnit.SquareFoot:
                    return (_value*SIUnit.ToSquareFoot).ToString("0.00", CultureInfo.InvariantCulture) + " ft²";

                default:
                    return _value.ToString("0.00", CultureInfo.InvariantCulture) + " m²";
            }
        }
Ejemplo n.º 2
0
 public string ToString(DynamoAreaUnit unit)
 {
     return BuildString(unit);
 }