6void VolumeToString(
const Volume& val,
char* out,
int maxlen) {
8 strncpy(out,
"? m³", maxlen);
14 num = val.inCubicKilometers();
17 num = val.inCubicMeters();
20 num = val.inCubicDecimeters();
23 num = val.inMilliliters();
26 num = val.inCubicMillimeters();
29 num = val.inCubicMicrometers();
31 snprintf(out, maxlen, format, num);
37#if defined(ESP32) || defined(ESP8266) || defined(__linux__)
39std::string Volume::asString()
const {
41 VolumeToString(*
this, out, 16);
49String Volume::asArduinoString()
const {
51 VolumeToString(*
this, out, 16);
59 VolumeToString(val, out, 16);
Representation of volume, internally stored as floating-point cubic meters.
For convenience conversion from roo_time::Duration.
roo_logging::Stream & operator<<(roo_logging::Stream &os, const Area &val)
Volume VolumeInCubicMeters(float volume)
Returns a volume object equivalent to the specified volume expressed in cubic meters.
Volume VolumeInCubicKilometers(float volume)
Returns a volume object equivalent to the specified volume expressed in cubic kilometers.
Volume VolumeInCubicDecimeters(float volume)
Returns a volume object equivalent to the specified volume expressed in liters.
Volume VolumeInMilliliters(float volume)
Returns a volume object equivalent to the specified volume expressed in milliliters.
Volume VolumeInCubicMillimeters(float volume)
Returns a volume object equivalent to the specified volume expressed in cubic millimeters.