Download the PHP package andanteproject/measurement without Composer

On this page you can find all versions of the php package andanteproject/measurement. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package measurement

Andante Project Logo

Measurement

PHP Library - AndanteProject

Latest Version CI Php8 PhpStan

A modern, type-safe PHP library for handling physical measurements with automatic unit conversion, internationalization, and precise calculations.

Table of Contents

Features

Installation

Requirements

Quick Start

Core Concepts

Dimension vs Unit vs Quantity

Three Levels of Type Safety

The library provides three levels of specificity for type-hinting quantities. This allows you to be as strict or flexible as your use case requires - from accepting any length unit, to requiring a specific measurement system, to enforcing an exact unit.

Creating Quantities

There are multiple ways to create quantities, each corresponding to the three levels of type safety. Use NumberFactory::create() to create precise numeric values from strings, integers, or floats.

Working with Quantities

Once you have quantity objects, you can convert between units, perform arithmetic, compare values, and more. All operations are immutable - they return new quantity objects rather than modifying the original.

Conversions

Use the to() method to convert a quantity to a different unit within the same dimension. The conversion is handled automatically using the library's conversion factor registry.

Arithmetic

Quantities support addition, subtraction, multiplication by scalars, and division by scalars. When adding or subtracting quantities with different units, the right operand is automatically converted to the left operand's unit.

Dimensional Analysis

When multiplying or dividing quantities, the library automatically determines the result type:

Comparisons

Compare quantities using intuitive methods. Comparisons work across different units - the library automatically converts to a common unit before comparing.

Auto-Scaling

The autoScale() method automatically converts a quantity to the most human-readable unit. It prefers values between 1 and 1000, choosing larger or smaller units as appropriate.

Parsing and Formatting

The library includes powerful parsing and formatting capabilities with full internationalization support. Parse measurement strings from user input, and format quantities for display in any locale.

Parsing Strings

Convert strings like "100 km" or "5.5 kWh" into quantity objects. The parser handles unit symbols, full unit names, and locale-specific number formats.

ParseOptions Reference

Option Method Default Description
locale fromLocale($locale) / withLocale($locale) null Locale for number formatting (e.g., 'it_IT', 'de_DE'). Determines thousand/decimal separators via ICU.
thousandSeparator withThousandSeparator($sep) ',' Character used as thousand separator. Overrides locale setting.
decimalSeparator withDecimalSeparator($sep) '.' Character used as decimal separator. Overrides locale setting.
defaultUnit withDefaultUnit($unit) null Unit to assume when parsing numbers without unit symbols (e.g., '100'100 m).

Formatting Output

Format quantities for display with control over style, precision, and locale. The formatter supports multiple styles (Short, Long, Narrow) and translates unit names into 9 languages.

FormatOptions Reference

Option Method Default Description
locale fromLocale($locale) / withLocale($locale) null Locale for number formatting (thousand/decimal separators).
unitLocale withUnitLocale($locale) same as locale Separate locale for unit name translations. Allows Italian numbers with English unit names.
precision withPrecision($int) null (auto) Number of decimal places. null preserves input precision and removes trailing zeros.
thousandSeparator withThousandSeparator($sep) ',' Character used as thousand separator. Overrides locale setting.
decimalSeparator withDecimalSeparator($sep) '.' Character used as decimal separator. Overrides locale setting.
style withStyle($style) FormatStyle::Short Output style (see FormatStyle table below).
notation withSymbolNotation($notation) SymbolNotation::Default Symbol notation style (see SymbolNotation table below).

FormatStyle Options

Style Example Description
FormatStyle::Short "1,500 m" Unit symbol with space (default).
FormatStyle::Long "1,500 meters" Full unit name, translated if available.
FormatStyle::Narrow "1,500m" Unit symbol without space.
FormatStyle::ValueOnly "1,500" Numeric value only, no unit. Useful for charts and data export.
FormatStyle::UnitSymbolOnly "m" Unit symbol only, no value. Useful for table headers.
FormatStyle::UnitNameOnly "meters" Full unit name only, no value. Useful for legends.

SymbolNotation Options

Notation Example Description
SymbolNotation::Default "Gbps", "kWh", "m³" Most common/recognizable form.
SymbolNotation::IEEE "Gbit/s", "kW·h" Technical/standards-compliant form.
SymbolNotation::ASCII "m3", "um", "kW*h" Keyboard-friendly, no special characters.
SymbolNotation::Unicode "m³", "μm", "kW·h" Proper Unicode symbols.

Registries

The library uses four registries to manage units, conversions, and dimensional analysis. All registries are pre-configured with built-in quantities.

UnitRegistry

Maps units to their quantity classes. Used for parsing and creating quantities.

ConversionFactorRegistry

Stores conversion factors from each unit to its dimension's base unit.

ResultQuantityRegistry

Determines what quantity class to return from dimensional operations.

FormulaUnitRegistry

Maps dimensional formulas to default units for each system. When the library creates a result from dimensional analysis, it uses this registry to determine which unit to express the result in.

QuantityDefaultConfigProviderInterface

The QuantityDefaultConfigProviderInterface is the recommended way to register custom quantities with all four registries at once. Instead of manually registering with each registry, implement this interface to centralize your quantity's configuration.

Adding Custom Quantities

The library is fully extensible - you can add your own quantity types that integrate seamlessly with the existing system. This section walks through creating a custom "Viscosity" quantity as an example. The same pattern applies to any physical quantity you need to add.

Step 1: Create the Dimension

A dimension represents the physical nature of a quantity, defined by its dimensional formula using the seven SI base dimensions: Length (L), Mass (M), Time (T), Electric Current (I), Temperature (Θ), Amount of Substance (N), and Luminous Intensity (J).

Examples of dimensional formulas:

Step 2: Create the Unit Enum

Units are implemented as PHP enums that implement UnitInterface. Each unit defines its symbol, name, dimension, and measurement system (SI, Metric, or Imperial). The enum pattern provides type safety and IDE autocompletion.

Step 3: Create the Quantity Interface

Create an interface that extends QuantityInterface. This enables type-hinting for your quantity in function signatures and allows for the three-level type safety pattern (generic → system-specific → unit-specific).

Step 4: Create Quantity Classes

Create the actual quantity classes that hold values. Use the provided traits (ConvertibleTrait, ComparableTrait, CalculableTrait, AutoScalableTrait) to get conversion, comparison, arithmetic, and auto-scaling functionality without writing boilerplate code.

Step 5: Create a Provider

The provider centralizes all registry configuration for your quantity. It defines which units exist, their conversion factors to the base unit, and how dimensional analysis results should be mapped. This is the recommended pattern used by all built-in quantities.

Step 6: Register with the Library

Call your provider's registration methods during application bootstrap to make your quantity available throughout the library. After registration, parsing, formatting, conversions, and dimensional analysis will all work with your custom quantity.

Step 7: Add Translations (Optional)

To enable localized formatting with FormatStyle::Long, register translations programmatically using the TranslationLoader::registerTranslation() method.

The registerTranslation() method accepts a unit and an array mapping plural rules (one, other) to translated names. Registered translations take precedence over built-in translations, so you can also use this to override existing unit names if needed.

Available Quantities

The library provides 29 quantity types with 200+ units. Each quantity includes:


Length [L¹]

The SI base unit of distance. Supports metric and imperial systems.

Scope Class Unit Symbol
Generic Length any -
System-specific MetricLength any metric (MetricLengthUnit) -
System-specific ImperialLength any imperial (ImperialLengthUnit) -
Unit-specific Meter Meter m
Unit-specific Kilometer Kilometer km
Unit-specific Hectometer Hectometer hm
Unit-specific Decameter Decameter dam
Unit-specific Decimeter Decimeter dm
Unit-specific Centimeter Centimeter cm
Unit-specific Millimeter Millimeter mm
Unit-specific Micrometer Micrometer μm
Unit-specific Nanometer Nanometer nm
Unit-specific Foot Foot ft
Unit-specific Inch Inch in
Unit-specific Yard Yard yd
Unit-specific Mile Mile mi
Unit-specific NauticalMile NauticalMile nmi

Mass [M¹]

The SI base unit of mass. Supports metric and imperial systems.

Scope Class Unit Symbol
Generic Mass any -
System-specific MetricMass any metric (MetricMassUnit) -
System-specific ImperialMass any imperial (ImperialMassUnit) -
Unit-specific Kilogram Kilogram kg
Unit-specific Gram Gram g
Unit-specific Milligram Milligram mg
Unit-specific Microgram Microgram μg
Unit-specific Tonne Tonne t
Unit-specific Hectogram Hectogram hg
Unit-specific Decagram Decagram dag
Unit-specific Decigram Decigram dg
Unit-specific Centigram Centigram cg
Unit-specific Pound Pound lb
Unit-specific Ounce Ounce oz
Unit-specific Stone Stone st
Unit-specific ShortTon ShortTon ton
Unit-specific LongTon LongTon long ton

Time [T¹]

The SI base unit of time. All Time classes include PHP DateInterval integration:

Scope Class Unit Symbol
Generic Time any (TimeUnit) -
Unit-specific Second Second s
Unit-specific Millisecond Millisecond ms
Unit-specific Microsecond Microsecond μs
Unit-specific Nanosecond Nanosecond ns
Unit-specific Minute Minute min
Unit-specific Hour Hour h
Unit-specific Day Day d
Unit-specific Week Week wk

Temperature [Θ¹]

Uses affine conversions (factor + offset) for Celsius and Fahrenheit.

Scope Class Unit Symbol
Generic Temperature any (TemperatureUnit) -
Unit-specific Kelvin Kelvin K
Unit-specific Celsius Celsius °C
Unit-specific Fahrenheit Fahrenheit °F

Electric Current [I¹]

The SI base unit of electric current.

Scope Class Unit Symbol
Generic ElectricCurrent any (ElectricCurrentUnit) -
Unit-specific Ampere Ampere A
Unit-specific Kiloampere Kiloampere kA
Unit-specific Milliampere Milliampere mA
Unit-specific Microampere Microampere μA
Unit-specific Nanoampere Nanoampere nA

Area [L²]

Derived from Length × Length.

Scope Class Unit Symbol
Generic Area any -
System-specific MetricArea any metric (MetricAreaUnit) -
System-specific ImperialArea any imperial (ImperialAreaUnit) -
Unit-specific SquareMeter SquareMeter
Unit-specific SquareKilometer SquareKilometer km²
Unit-specific SquareCentimeter SquareCentimeter cm²
Unit-specific SquareMillimeter SquareMillimeter mm²
Unit-specific SquareDecimeter SquareDecimeter dm²
Unit-specific Hectare Hectare ha
Unit-specific Are Are a
Unit-specific SquareFoot SquareFoot ft²
Unit-specific SquareInch SquareInch in²
Unit-specific SquareYard SquareYard yd²
Unit-specific SquareMile SquareMile mi²
Unit-specific Acre Acre ac

Volume [L³]

Derived from Length × Length × Length. Includes gas measurement units.

Scope Class Unit Symbol
Generic Volume any -
System-specific MetricVolume any metric (MetricVolumeUnit) -
System-specific ImperialVolume any imperial (ImperialVolumeUnit) -
System-specific GasVolume gas measurement (GasVolumeUnit) -
Unit-specific CubicMeter CubicMeter
Unit-specific CubicDecimeter CubicDecimeter dm³
Unit-specific CubicCentimeter CubicCentimeter cm³
Unit-specific CubicMillimeter CubicMillimeter mm³
Unit-specific Liter Liter L
Unit-specific Deciliter Deciliter dL
Unit-specific Centiliter Centiliter cL
Unit-specific Milliliter Milliliter mL
Unit-specific Hectoliter Hectoliter hL
Unit-specific Kiloliter Kiloliter kL
Unit-specific CubicFoot CubicFoot ft³
Unit-specific CubicInch CubicInch in³
Unit-specific CubicYard CubicYard yd³
Unit-specific USGallon USGallon gal
Unit-specific USQuart USQuart qt
Unit-specific USPint USPint pt
Unit-specific USCup USCup cup
Unit-specific USFluidOunce USFluidOunce fl oz
Unit-specific USTablespoon USTablespoon tbsp
Unit-specific USTeaspoon USTeaspoon tsp
Unit-specific ImperialGallon ImperialGallon imp gal
Unit-specific ImperialQuart ImperialQuart imp qt
Unit-specific ImperialPint ImperialPint imp pt
Unit-specific ImperialFluidOunce ImperialFluidOunce imp fl oz
Unit-specific StandardCubicMeter StandardCubicMeter Smc
Unit-specific NormalCubicMeter NormalCubicMeter Nmc
Unit-specific StandardCubicFoot StandardCubicFoot scf
Unit-specific ThousandCubicFeet ThousandCubicFeet Mcf

Velocity [L¹T⁻¹]

Derived from Length ÷ Time.

Scope Class Unit Symbol
Generic Velocity any -
System-specific MetricVelocity any metric (MetricVelocityUnit) -
System-specific ImperialVelocity any imperial (ImperialVelocityUnit) -
Unit-specific MeterPerSecond MeterPerSecond m/s
Unit-specific KilometerPerHour KilometerPerHour km/h
Unit-specific CentimeterPerSecond CentimeterPerSecond cm/s
Unit-specific MillimeterPerSecond MillimeterPerSecond mm/s
Unit-specific MilePerHour MilePerHour mph
Unit-specific FootPerSecond FootPerSecond ft/s
Unit-specific Knot Knot kn

Acceleration [L¹T⁻²]

Derived from Velocity ÷ Time.

Scope Class Unit Symbol
Generic Acceleration any -
System-specific MetricAcceleration any metric (MetricAccelerationUnit) -
System-specific ImperialAcceleration any imperial (ImperialAccelerationUnit) -
Unit-specific MeterPerSecondSquared MeterPerSecondSquared m/s²
Unit-specific CentimeterPerSecondSquared CentimeterPerSecondSquared cm/s²
Unit-specific MillimeterPerSecondSquared MillimeterPerSecondSquared mm/s²
Unit-specific Gal Gal Gal
Unit-specific StandardGravity StandardGravity g
Unit-specific FootPerSecondSquared FootPerSecondSquared ft/s²
Unit-specific InchPerSecondSquared InchPerSecondSquared in/s²

Force [L¹M¹T⁻²]

Derived from Mass × Acceleration.

Scope Class Unit Symbol
Generic Force any -
System-specific SIForce any SI (SIForceUnit) -
System-specific ImperialForce any imperial (ImperialForceUnit) -
Unit-specific Newton Newton N
Unit-specific Kilonewton Kilonewton kN
Unit-specific Meganewton Meganewton MN
Unit-specific Millinewton Millinewton mN
Unit-specific Micronewton Micronewton μN
Unit-specific Dyne Dyne dyn
Unit-specific PoundForce PoundForce lbf
Unit-specific OunceForce OunceForce ozf
Unit-specific Kip Kip kip
Unit-specific Poundal Poundal pdl

Pressure [L⁻¹M¹T⁻²]

Derived from Force ÷ Area.

Scope Class Unit Symbol
Generic Pressure any -
System-specific SIPressure any SI (SIPressureUnit) -
System-specific ImperialPressure any imperial (ImperialPressureUnit) -
Unit-specific Pascal Pascal Pa
Unit-specific Hectopascal Hectopascal hPa
Unit-specific Kilopascal Kilopascal kPa
Unit-specific Megapascal Megapascal MPa
Unit-specific Gigapascal Gigapascal GPa
Unit-specific Bar Bar bar
Unit-specific Millibar Millibar mbar
Unit-specific Atmosphere Atmosphere atm
Unit-specific Torr Torr Torr
Unit-specific PoundPerSquareInch PoundPerSquareInch psi
Unit-specific PoundPerSquareFoot PoundPerSquareFoot psf
Unit-specific InchOfMercury InchOfMercury inHg
Unit-specific InchOfWater InchOfWater inH₂O

Energy [L²M¹T⁻²]

Work and heat. Includes electrical and thermal units.

Scope Class Unit Symbol
Generic Energy any -
System-specific SIEnergy any SI (SIEnergyUnit) -
System-specific ElectricEnergy any electric (ElectricEnergyUnit) -
System-specific ThermalEnergy any thermal (ThermalEnergyUnit) -
Unit-specific Joule Joule J
Unit-specific Kilojoule Kilojoule kJ
Unit-specific Megajoule Megajoule MJ
Unit-specific WattHour WattHour Wh
Unit-specific KilowattHour KilowattHour kWh
Unit-specific MegawattHour MegawattHour MWh
Unit-specific GigawattHour GigawattHour GWh
Unit-specific Calorie Calorie cal
Unit-specific Kilocalorie Kilocalorie kcal
Unit-specific BritishThermalUnit BritishThermalUnit BTU

Power [L²M¹T⁻³]

Derived from Energy ÷ Time.

Scope Class Unit Symbol
Generic Power any -
System-specific SIPower any SI (SIPowerUnit) -
System-specific ImperialPower any imperial (ImperialPowerUnit) -
Unit-specific Watt Watt W
Unit-specific Milliwatt Milliwatt mW
Unit-specific Kilowatt Kilowatt kW
Unit-specific Megawatt Megawatt MW
Unit-specific Gigawatt Gigawatt GW
Unit-specific MechanicalHorsepower MechanicalHorsepower hp
Unit-specific ElectricalHorsepower ElectricalHorsepower hp(E)
Unit-specific MetricHorsepower MetricHorsepower PS
Unit-specific FootPoundPerSecond FootPoundPerSecond ft⋅lbf/s
Unit-specific BTUPerHour BTUPerHour BTU/h

Density [L⁻³M¹]

Derived from Mass ÷ Volume.

Scope Class Unit Symbol
Generic Density any -
System-specific SIDensity any SI (SIDensityUnit) -
System-specific ImperialDensity any imperial (ImperialDensityUnit) -
Unit-specific KilogramPerCubicMeter KilogramPerCubicMeter kg/m³
Unit-specific GramPerCubicMeter GramPerCubicMeter g/m³
Unit-specific GramPerCubicCentimeter GramPerCubicCentimeter g/cm³
Unit-specific GramPerLiter GramPerLiter g/L
Unit-specific KilogramPerLiter KilogramPerLiter kg/L
Unit-specific MilligramPerCubicMeter MilligramPerCubicMeter mg/m³
Unit-specific TonnePerCubicMeter TonnePerCubicMeter t/m³
Unit-specific PoundPerCubicFoot PoundPerCubicFoot lb/ft³
Unit-specific PoundPerCubicInch PoundPerCubicInch lb/in³
Unit-specific PoundPerGallon PoundPerGallon lb/gal
Unit-specific OuncePerCubicInch OuncePerCubicInch oz/in³
Unit-specific SlugPerCubicFoot SlugPerCubicFoot slug/ft³

Frequency [T⁻¹]

Derived from 1 ÷ Time.

Scope Class Unit Symbol
Generic Frequency any (FrequencyUnit) -
Unit-specific Hertz Hertz Hz
Unit-specific Millihertz Millihertz mHz
Unit-specific Kilohertz Kilohertz kHz
Unit-specific Megahertz Megahertz MHz
Unit-specific Gigahertz Gigahertz GHz
Unit-specific Terahertz Terahertz THz
Unit-specific RevolutionPerMinute RevolutionPerMinute RPM
Unit-specific RevolutionPerSecond RevolutionPerSecond RPS
Unit-specific BeatsPerMinute BeatsPerMinute BPM

Angle [dimensionless]

Plane angle measurement.

Scope Class Unit Symbol
Generic Angle any (AngleUnit) -
Unit-specific Radian Radian rad
Unit-specific Milliradian Milliradian mrad
Unit-specific Degree Degree °
Unit-specific Arcminute Arcminute
Unit-specific Arcsecond Arcsecond
Unit-specific Gradian Gradian gon
Unit-specific Revolution Revolution rev
Unit-specific Turn Turn tr

Electric Potential [L²M¹T⁻³I⁻¹]

Voltage. Derived from Power ÷ Current.

Scope Class Unit Symbol
Generic ElectricPotential any (ElectricPotentialUnit) -
Unit-specific Volt Volt V
Unit-specific Megavolt Megavolt MV
Unit-specific Kilovolt Kilovolt kV
Unit-specific Millivolt Millivolt mV
Unit-specific Microvolt Microvolt μV

Electric Resistance [L²M¹T⁻³I⁻²]

Derived from Voltage ÷ Current.

Scope Class Unit Symbol
Generic ElectricResistance any (ElectricResistanceUnit) -
Unit-specific Ohm Ohm Ω
Unit-specific Megaohm Megaohm
Unit-specific Kiloohm Kiloohm
Unit-specific Milliohm Milliohm
Unit-specific Microohm Microohm μΩ

Electric Capacitance [L⁻²M⁻¹T⁴I²]

Ability to store electric charge.

Scope Class Unit Symbol
Generic ElectricCapacitance any (ElectricCapacitanceUnit) -
Unit-specific Farad Farad F
Unit-specific Millifarad Millifarad mF
Unit-specific Microfarad Microfarad μF
Unit-specific Nanofarad Nanofarad nF
Unit-specific Picofarad Picofarad pF

Electric Charge [T¹I¹]

Derived from Current × Time.

Scope Class Unit Symbol
Generic ElectricCharge any (ElectricChargeUnit) -
Unit-specific Coulomb Coulomb C
Unit-specific Millicoulomb Millicoulomb mC
Unit-specific Microcoulomb Microcoulomb μC
Unit-specific AmpereHour AmpereHour Ah
Unit-specific MilliampereHour MilliampereHour mAh

Inductance [L²M¹T⁻²I⁻²]

Property of an electrical conductor.

Scope Class Unit Symbol
Generic Inductance any (InductanceUnit) -
Unit-specific Henry Henry H
Unit-specific Millihenry Millihenry mH
Unit-specific Microhenry Microhenry μH
Unit-specific Nanohenry Nanohenry nH

Magnetic Flux [L²M¹T⁻²I⁻¹]

Measure of total magnetic field through a surface.

Scope Class Unit Symbol
Generic MagneticFlux any (MagneticFluxUnit) -
Unit-specific Weber Weber Wb
Unit-specific Milliweber Milliweber mWb
Unit-specific Microweber Microweber μWb
Unit-specific Maxwell Maxwell Mx

Luminous Intensity [J¹]

The SI base unit of luminous intensity.

Scope Class Unit Symbol
Generic LuminousIntensity any (LuminousIntensityUnit) -
Unit-specific Candela Candela cd
Unit-specific Kilocandela Kilocandela kcd
Unit-specific Millicandela Millicandela mcd
Unit-specific Microcandela Microcandela μcd

Luminous Flux [J¹]

Total amount of visible light emitted.

Scope Class Unit Symbol
Generic LuminousFlux any (LuminousFluxUnit) -
Unit-specific Lumen Lumen lm
Unit-specific Kilolumen Kilolumen klm
Unit-specific Millilumen Millilumen mlm

Illuminance [L⁻²J¹]

Derived from Luminous Flux ÷ Area.

Scope Class Unit Symbol
Generic Illuminance any (IlluminanceUnit) -
Unit-specific Lux Lux lx
Unit-specific Kilolux Kilolux klx
Unit-specific Millilux Millilux mlx
Unit-specific FootCandle FootCandle fc

Calorific Value [L⁻¹M¹T⁻²]

Energy per unit volume. Used for gas billing.

Scope Class Unit Symbol
Generic CalorificValue any -
System-specific MetricCalorificValue any metric (MetricCalorificValueUnit) -
System-specific ImperialCalorificValue any imperial (ImperialCalorificValueUnit) -
Unit-specific JoulePerCubicMeter JoulePerCubicMeter J/m³
Unit-specific KilojoulePerCubicMeter KilojoulePerCubicMeter kJ/m³
Unit-specific MegajoulePerCubicMeter MegajoulePerCubicMeter MJ/m³
Unit-specific GigajoulePerCubicMeter GigajoulePerCubicMeter GJ/m³
Unit-specific BTUPerCubicFoot BTUPerCubicFoot BTU/ft³
Unit-specific ThermPerCubicFoot ThermPerCubicFoot thm/ft³

Digital Information [D¹]

Data storage capacity. Supports SI (decimal) and IEC (binary) prefixes.

Scope Class Unit Symbol
Generic DigitalInformation any -
System-specific SI\DigitalInformation any SI (SIDigitalUnit) -
System-specific SI\BitDigitalInformation any SI bit (SIBitUnit) -
System-specific SI\ByteDigitalInformation any SI byte (SIByteUnit) -
System-specific IEC\DigitalInformation any IEC (IECDigitalUnit) -
System-specific IEC\BitDigitalInformation any IEC bit (IECBitUnit) -
System-specific IEC\ByteDigitalInformation any IEC byte (IECByteUnit) -

SI Units (decimal, powers of 10):

Scope Class Unit Symbol
Unit-specific Bit Bit b
Unit-specific Kilobit Kilobit Kb
Unit-specific Megabit Megabit Mb
Unit-specific Gigabit Gigabit Gb
Unit-specific Terabit Terabit Tb
Unit-specific Petabit Petabit Pb
Unit-specific Byte Byte B
Unit-specific Kilobyte Kilobyte KB
Unit-specific Megabyte Megabyte MB
Unit-specific Gigabyte Gigabyte GB
Unit-specific Terabyte Terabyte TB
Unit-specific Petabyte Petabyte PB

IEC Units (binary, powers of 2):

Scope Class Unit Symbol
Unit-specific Kibibit Kibibit Kib
Unit-specific Mebibit Mebibit Mib
Unit-specific Gibibit Gibibit Gib
Unit-specific Tebibit Tebibit Tib
Unit-specific Pebibit Pebibit Pib
Unit-specific Kibibyte Kibibyte KiB
Unit-specific Mebibyte Mebibyte MiB
Unit-specific Gibibyte Gibibyte GiB
Unit-specific Tebibyte Tebibyte TiB
Unit-specific Pebibyte Pebibyte PiB

Data Transfer Rate [D¹T⁻¹]

Measures the speed of data transmission, commonly used for network bandwidth, internet connection speeds, and file transfer rates. Like Digital Information, this quantity supports both SI (decimal) and IEC (binary) prefixes. ISPs and network equipment typically advertise speeds using SI units (e.g., "100 Mbps fiber"), while operating systems often report actual transfer rates in IEC units (e.g., "12 MiB/s"). This distinction matters because 100 Mbps (megabits per second) equals 12.5 MB/s (megabytes per second) but only about 11.92 MiB/s (mebibytes per second).

Scope Class Unit Symbol
Generic DataTransferRate any -
System-specific SI\TransferRate any SI (SITransferRateUnit) -
System-specific SI\BitTransferRate any SI bit (BitTransferRateUnit) -
System-specific SI\ByteTransferRate any SI byte (ByteTransferRateUnit) -
System-specific IEC\TransferRate any IEC (IECTransferRateUnit) -
System-specific IEC\BitTransferRate any IEC bit (IECBitTransferRateUnit) -
System-specific IEC\ByteTransferRate any IEC byte (IECByteTransferRateUnit) -

SI Units:

Scope Class Unit Symbol
Unit-specific BitPerSecond BitPerSecond bps
Unit-specific KilobitPerSecond KilobitPerSecond kbps
Unit-specific MegabitPerSecond MegabitPerSecond Mbps
Unit-specific GigabitPerSecond GigabitPerSecond Gbps
Unit-specific BytePerSecond BytePerSecond B/s
Unit-specific KilobytePerSecond KilobytePerSecond KB/s
Unit-specific MegabytePerSecond MegabytePerSecond MB/s
Unit-specific GigabytePerSecond GigabytePerSecond GB/s

IEC Units:

Scope Class Unit Symbol
Unit-specific KibibitPerSecond KibibitPerSecond Kibps
Unit-specific MebibitPerSecond MebibitPerSecond Mibps
Unit-specific GibibitPerSecond GibibitPerSecond Gibps
Unit-specific KibibytePerSecond KibibytePerSecond KiB/s
Unit-specific MebibytePerSecond MebibytePerSecond MiB/s
Unit-specific GibibytePerSecond GibibytePerSecond GiB/s

Testing

Docker Support


Built with ❤️ by AndanteProject team.


All versions of measurement with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package andanteproject/measurement contains the following files

Loading the files please wait ...