-
Notifications
You must be signed in to change notification settings - Fork 6
Scientific notation #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Scientific notation #282
Conversation
This reverts commit de10995.
Shifting @nihalzp comments here: |
|
This issue arose while testing this: |
|
We use |
adisidev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping this too. I think simply using "Format" should work as your IDE will be smart enough to detect the presence of a .clang-forrmat file and use that as the style guide for formatting. Lmk.
Run mapfile -t FILES < <(git ls-files '*.[ch]pp' '*.c' '*.h')
clang-format version: Ubuntu clang-format version 18.1.3 (1ubuntu1)
Running clang-format diff...
--- include/string_to_decimal_converter.hpp 2025-06-22 00:50:12.272782406 +0000
+++ /dev/fd/63 2025-06-22 00:50:29.533764039 +0000
@@ -5,13 +5,14 @@
#include <vector>
/**
- * @brief A utility class for converting string representations of numbers to decimal format.
- *
+ * @brief A utility class for converting string representations of numbers to
+ * decimal format.
+ *
* This class handles various number formats including:
* - Regular decimal numbers (e.g. "123.456", "123,456")
* - Scientific notation (e.g. "1.23e-4", "1.23E4")
* - Special value "NA"
- *
+ *
* For scientific notation:
* - Both 'e' and 'E' are supported as exponent markers
* - The mantissa can use either '.' or ',' as decimal separator
❌ include/string_to_decimal_converter.hpp
--- src/misc/string_to_decimal_converter.cpp 2025-06-22 00:50:12.427785355 +0000
+++ /dev/fd/63 2025-06-22 00:50:30.488765944 +0000
@@ -7,7 +7,8 @@
bool StringToDecimalConverter::is_valid_char(char ch)
{
- return (std::isdigit(ch)) || ch == point_ || ch == comma_ || ch == minus_ || ch == 'e' || ch == 'E';
+ return (std::isdigit(ch)) || ch == point_ || ch == comma_ || ch == minus_ ||
+ ch == 'e' || ch == 'E';
}
std::string StringToDecimalConverter::remove_char(std::string str, char ch)
❌ src/misc/string_to_decimal_converter.cpp
Error: clang-format issues detected in the following files:
include/string_to_decimal_converter.hpp
src/misc/string_to_decimal_converter.cpp
Run 'clang-format -i' to fix.The |
Add support for scientific notation
Fixes #260 @adisidev