public virtual float ReadContentAsFloat()
{
if (!CanReadContentAs())
{
throw CreateReadContentAsException(nameof(ReadContentAsFloat));
}
try
{
return XmlConvert.ToSingle(InternalReadContentAsString());
}
catch (FormatException e)
{
throw new XmlException(SR.Xml_ReadContentAsFormatException, "Float", e, this as IXmlLineInfo);
}
}