Float
Double-precision floating-point scalar type
Audience: Programmer
The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.
Format
64-bit IEEE 754 floating-point
Approximately 15-17 decimal digits of precision
Range: ±1.7976931348623157E+308
Supports scientific notation
Usage
type ItemMovement {
quantity: Float!
unitPrice: Float
totalValue: Float
}
mutation {
createItemMovement(input: {
quantity: 10.5
unitPrice: 29.99
}) {
itemMovement {
totalValue # Returns Float
}
}
}Common Float Fields
Quantities with decimals
Prices and monetary values
Percentages and ratios
Coordinates (latitude/longitude)
Measurements and dimensions
Precision Considerations
Best Practices
Use for scientific calculations
Consider fixed-point for money (or use Int for cents)
Be aware of precision limitations
Use rounding when displaying to users
See Also
Last updated
Was this helpful?
