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

SetFieldValue() public method

Sets the field value.
The value is not of type System.Float
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)
        {
            float? floatValue = value as float?;
            if (floatValue.HasValue)
            {
                return floatValue.Value.ToString(CultureInfo.InvariantCulture);
            }

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