using System;

namespace Quadarax.Foundation.QConsole.Value
{
    public class DecimalValue : AbstractValue
    {
        public DecimalValue() : base()
        {

        }

        public DecimalValue(decimal value) : base(typeof(decimal), value)
        {
        }

        protected override object ConvertStringToValue(string valueAsString)
        {
            return decimal.Parse(valueAsString);
        }

        public override string AsString()
        {
            return HasValue ? Get().ToString() : string.Empty;
        }
    }
}
