[#BloombergLP-bdlb-NumericParseUtil-characterToDigit] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NumericParseUtil.adoc[NumericParseUtil]::characterToDigit :relfileprefix: ../../../ :mrdocs: Return the digit value of `character` in `base`, or ‐1 if invalid. == Synopsis Declared in `<bdlb_numericparseutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int characterToDigit( char character, int base); ---- == Description Determine whether the specified `character` represents a digit in the specified `base`; return the numeric equivalent if so, and ‐1 otherwise. The behavior is undefined if either `character` or `base` is 0 and unless `2 <= base` and `base <= 36` (i.e., bases where digits are representable by characters in the range [`0`‐`9`], [`a`‐`z`], or [`A`‐`Z`]). == Return Value digit value in `[0 .. base)]`, or ‐1 if `character` is not a valid digit in `base` == Parameters [cols="1,4"] |=== | Name| Description | *character* | character to interpret as a digit | *base* | numeric base in `[2 .. 36]` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#