FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplatesGuides
Release Notes
Source514
  1. MooseStack
  2. Data Types
  3. Floating Point Types

On this page

Float64 (Default)Float32Type Mapping ReferenceSee Also

Floating Point Types

ClickHouse supports IEEE 754 floating-point numbers in 32-bit and 64-bit precision.

Float64 (Default)

64-bit double-precision floating point. This is the default for number in TypeScript and float in Python.

class SensorData(BaseModel):    temperature: float      # Float64    humidity: float         # Float64

Float32

32-bit single-precision floating point. Use when storage is critical and reduced precision is acceptable.

from typing import Annotatedfrom moose_lib import ClickhouseSize class Coordinates(BaseModel):    latitude: Annotated[float, ClickhouseSize(4)]    # Float32    longitude: Annotated[float, ClickhouseSize(4)]   # Float32

Type Mapping Reference

ClickHouse TypeTypeScript HelperTypeScript VerbosePython
Float32Float32number & tags.Type<"float">
Annotated[float, ClickhouseSize(4)]
Float64Float64 or numbernumberfloat
Float64 vs Float32

Prefer Float64 for most calculations—it's the default and provides better precision. Only use Float32 when storage savings are critical and you can tolerate ~7 digits of precision instead of ~15.

Precision considerations

Floating-point numbers have inherent precision limitations. For financial calculations or when exact decimal representation is required, use Decimal types instead.

See Also

  • Integers — Signed and unsigned integer types
  • Decimals — Fixed-point precision for financial data
  • ClickHouse Float types — ClickHouse official documentation
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
    • Strings
    • LowCardinality
    • Integers
    • Floats
    • Decimals
    • Booleans
    • Date & Time
    • Network
    • Arrays
    • Maps
    • Nested
    • Tuples
    • Enums
    • Geometry
    • JSON
    • Nullable
    • Aggregates
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Release Notes
Contribution
  • Documentation
  • Framework