aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/utility/Utilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/openvic-extension/utility/Utilities.cpp')
-rw-r--r--extension/src/openvic-extension/utility/Utilities.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/extension/src/openvic-extension/utility/Utilities.cpp b/extension/src/openvic-extension/utility/Utilities.cpp
index 5957b70..7450212 100644
--- a/extension/src/openvic-extension/utility/Utilities.cpp
+++ b/extension/src/openvic-extension/utility/Utilities.cpp
@@ -36,9 +36,8 @@ String Utilities::int_to_formatted_string(int64_t val) {
return (negative ? "-" : "") + String::num_int64(val);
}
-/* Float to formatted to 4 decimal place string. */
-String Utilities::float_to_formatted_string(float val) {
- static constexpr int64_t decimal_places = 4;
+/* Float to string formatted with the specified number of decimal places. */
+String Utilities::float_to_formatted_string(float val, int32_t decimal_places) {
return String::num(val, decimal_places).pad_decimals(decimal_places);
}