Svg.SvgUnit.ToPercentage C# (CSharp) Method

ToPercentage() public method

Converts the current unit to a percentage, if applicable.
public ToPercentage ( ) : SvgUnit
return SvgUnit
        public SvgUnit ToPercentage()
        {
            switch (this.Type)
            {
                case SvgUnitType.Percentage:
                    return this;
                case SvgUnitType.User:
                    return new SvgUnit(SvgUnitType.Percentage, this.Value * 100);
                default:
                    throw new NotImplementedException();
            }
        }