Glass.Mapper.Sc.DataMappers.SitecoreFieldDoubleMapper.SetFieldValue C# (CSharp) Method

SetFieldValue() public method

Sets the field value.
The value is not of type System.Double
public SetFieldValue ( object value, SitecoreFieldConfiguration config, SitecoreDataMappingContext context ) : string
value object The value.
config Glass.Mapper.Sc.Configuration.SitecoreFieldConfiguration The config.
context SitecoreDataMappingContext The context.
return string
        public override string SetFieldValue(object value, SitecoreFieldConfiguration config, SitecoreDataMappingContext context)
        {
            double? doubleValue = value as double?;
            if (doubleValue.HasValue)
            {
                return doubleValue.Value.ToString(CultureInfo.InvariantCulture);
            }

            throw new NotSupportedException("The value is not of type System.Double");
        }
    }