Skip to content

Consistently use BigDecimal.valueOf(double) *or* new BigDecimal(double) [JDBC517] #553

@firebird-automations

Description

@firebird-automations

Submitted by: @mrotteveel

The BigDecimal float/double conversion is a bit mixed. FBBigDecimalField and FBDecFloatField use equivalents of `BigDecimal.valueOf(double)` when setting double values, but FBFloatField and FBDoubleField use new BigDecimal(double) when getting a float/double as BigDecimal.

For consistency it might be better to use BigDecimal.valueOf(double) for both, although this may lead to a perceived loss of 'precision' for FBFloatField and FBDoubleField given the differences between the two methods of obtaining a BigDecimal from a floating point type.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions