DecimalToFirebirdDecFloatResolver

A class used to resolve a decimal into the FbDecFloat value that is written into a Firebird DECFLOAT column.

This IResolver<decimal, object> implementation converts a decimal into the FbDecFloat (boxed) that the FirebirdSql.Data.FirebirdClient driver writes into a DECFLOAT(16) or DECFLOAT(34) column. The coefficient and the scale of the decimal are kept as is, so 1.50m is written as 150E-2 and not 1.5E+0. It is used by the FirebirdDecFloatToDecimalPropertyHandler and the FirebirdDecFloatToNullableDecimalPropertyHandler when writing the entity property back to the database.

The counterpart of this class is the FirebirdDecFloatToDecimalResolver, which converts the value read from the column back into a decimal.

Usability

var resolver = new DecimalToFirebirdDecFloatResolver();
var value = resolver.Resolve(123.45m); // FbDecFloat, 12345E-2 (boxed)