MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / isNumber

Method isNumber

src/helper.cpp:378–389  ·  view source on GitHub ↗

* Checks if string is a number - a little bit buggy ... TODO */

Source from the content-addressed store, hash-verified

376 * Checks if string is a number - a little bit buggy ... TODO
377 */
378bool Helper::isNumber(const std::string& str) {
379 bool isNum = true;
380 size_t str_len = str.size();
381 for(size_t i = 0; i < str_len; ++i ) {
382 unsigned char c = static_cast<unsigned char>(str[i]);
383 if( !std::isdigit(c) && (c != '.' || c != ',' || c != '-') ) {
384 isNum = false;
385 break;
386 }
387 }
388 return isNum;
389}
390
391
392/*

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected