Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_string.h
| Show First 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | |||||
| * 155555555 -> 156M | * 155555555 -> 156M | ||||
| * 1000000000 -> 1B | * 1000000000 -> 1B | ||||
| * ... | * ... | ||||
| * | * | ||||
| * Length of 7 is the maximum of the resulting string, for example, `-15.5K\0`. | * Length of 7 is the maximum of the resulting string, for example, `-15.5K\0`. | ||||
| */ | */ | ||||
| void BLI_str_format_decimal_unit(char dst[7], int number_to_format) ATTR_NONNULL(); | void BLI_str_format_decimal_unit(char dst[7], int number_to_format) ATTR_NONNULL(); | ||||
| /** | /** | ||||
| * Format a count to up to 3 places (plus minus sign, plus '\0' terminator) string using long | |||||
| * number names abbreviations. Used to produce a compact representation of large numbers as | |||||
| * integers. | |||||
| * | |||||
| * It shows a lower bound instead of rounding the number. | |||||
| * | |||||
| * 1 -> 1 | |||||
| * 15 -> 15 | |||||
JacquesLucke: Would probably be good to mention that this (intentionally?) does not round the numbers. | |||||
| * 155 -> 155 | |||||
| * 1555 -> 1K | |||||
| * 15555 -> 15K | |||||
| * 155555 -> .1M | |||||
| * 1555555 -> 1M | |||||
| * 15555555 -> 15M | |||||
| * 155555555 -> .1B | |||||
| * 1000000000 -> 1B | |||||
| * ... | |||||
| * | |||||
| * Length of 5 is the maximum of the resulting string, for example, `-15K\0`. | |||||
| */ | |||||
| void BLI_str_format_integer_unit(char dst[5], int number_to_format) ATTR_NONNULL(); | |||||
| /** | |||||
| * Compare two strings without regard to case. | * Compare two strings without regard to case. | ||||
| * | * | ||||
| * \retval True if the strings are equal, false otherwise. | * \retval True if the strings are equal, false otherwise. | ||||
| */ | */ | ||||
| int BLI_strcaseeq(const char *a, const char *b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); | int BLI_strcaseeq(const char *a, const char *b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); | ||||
| /** | /** | ||||
| * Portable replacement for `strcasestr` (not available in MSVC) | * Portable replacement for `strcasestr` (not available in MSVC) | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines | |||||
Would probably be good to mention that this (intentionally?) does not round the numbers. Otherwise this would be 2k.