|
| QString | dblToStringWithUnits (double value, double switchFactor) |
| | returns the value converted to string, with units (K, M, G, T, P) applied for every 10³ factor over 1000
|
| |
| int | digitsAfterComma (double resolvableDiff) |
| | Get the number of digits required after the comma, given the difference to other values it should be distinguishable from.
|
| |
| QString | greatestCommonPrefix (QString const &str1, QString const &str2) |
| |
| int | greatestCommonPrefixLength (QString const &str1, QString const &str2) |
| | Find the (length of the) greatest common prefix of the two given strings.
|
| |
| QString | greatestCommonSuffix (QString const &str1, QString const &str2) |
| |
| int | greatestCommonSuffixLength (QString const &str1, QString const &str2) |
| |
| QString | joinQVariantAsString (QVector< QVariant > const &vec, QString const &joinStr) |
| |
| iAbase_API std::string | joinStdString (std::vector< std::string > &vec, std::string const &joinStr) |
| | join a vector of std::strings into one single string
|
| |
| QString | padOrTruncate (QString const &str, int size) |
| | Pads or truncates the given string to the given size.
|
| |
| QString | quoteString (QString const &str) |
| |
| int | requiredDigits (double value) |
| | Get the number of digits required for the given number (before the comma).
|
| |
| QStringList | splitPossiblyQuotedString (QString const &str) |
| | split a string at the space characters, while correctly treating quoted elements
|
| |
| QString | stripHTML (QString const &html) |
| | strip HTML tags from the given string
|
| |
| int digitsAfterComma |
( |
double |
resolvableDiff | ) |
|
Get the number of digits required after the comma, given the difference to other values it should be distinguishable from.
TODO: introduce "number of relevant digits" parameter / automatic determination? e.g. 9.125 -> 3, 9.98 -> 2, 9.5 -> 1; but what about e.g. 9.995 (->close enough to 10 to discard after comma?) Examples: resolvableDiff result >= 10 0 9.9999 - 1.0 0-1 (0 if resolvableDiff is exactly 1,6,4,... depending on whether resolvableDiff is 1.2,6.323, or ) 0.9999 - 0.1 1-2 (depending on whether resolvableDiff is 0.15,0.22,0.9333,... or exactly 0.1,0.4,...) 0.0999 - 0.01 2-3 0.0099 - 0.001 3-4
| QStringList splitPossiblyQuotedString |
( |
QString const & |
str | ) |
|
split a string at the space characters, while correctly treating quoted elements
Example: the string '"a rabbit" and "a horse"' would be split into three elements: "a rabbit", "and", "a horse" (the quotes are stripped from the elements). Note that only the double-quote character is considered as a quote by this function.
- Parameters
-
- Returns
- a list of strings split up at the whitespaces