This is hacking for a useful (non-malicious) purpose and I'm not sure what I want can be done but I'd like to try. I'm running software that is closed source so I can't modify the original function call. The call is:
sprintf(string, this->LabelFormat, value)
And this->LabelFormat
is %-#6.3g
by default. The purpose is to format labels for a legend of doubles, so value
is a number.
I can set this->LabelFormat
to whatever I want. I would like to perform a mapping from numbers to strings, for example:
value | string
--------------
0.0 | None
1.0 | I
2.0 | J
3.0 | K
and so on. Is it at all possible to manipulate the format string to perform a specified mapping for me since I cannot modify the original code?