Melchior FRANZ:
The previous message wasn't totally correct. Strings are now allowed, too. And the pattern is now '[ -+#]?\d*(\.\d*)?l?[fs]' and *may* be embedded in a string. There may only be one %s or %f, though. %% is allowed in the preamble/postamble. (Yes, %ls is allowed, too, and treated as %s.) Also, "end" is superfluous now.
This commit is contained in:
parent
db989269b8
commit
71dd0f8f96
1 changed files with 1 additions and 3 deletions
|
@ -141,13 +141,11 @@ format_callback(puObject *obj, int dx, int dy, void *n)
|
|||
}
|
||||
}
|
||||
|
||||
char buf[256], *end;
|
||||
char buf[256];
|
||||
const char *src = obj->getLabel();
|
||||
|
||||
if (number) {
|
||||
float value = atof(src);
|
||||
if (end == src)
|
||||
return; // not a number
|
||||
snprintf(buf, 256, format, value);
|
||||
} else {
|
||||
snprintf(buf, 256, format, src);
|
||||
|
|
Loading…
Add table
Reference in a new issue