9 | | What's the ''semantics'' of {{{len}}} here? Is it the number of ''available'' bytes in the output buffer, or is it the number of ''desired'' bytes to fill it up with? You're mixing the two! When thinking in bytes, the number of ''available'' bytes is 64 in the current code, whereas the number of ''desired'' (or ''maximum'') bytes to which to format the string does not make sense. Why would you want to ask the formatter "hey format me this number, I give use a quite large buffer, but make sure not to write more than 11 bytes"? No sense whatsoever. It's the desired UI look you care about, in some locales it'll take 8 bytes, in some it'll take 11, in some it'll take even more. The formatter will know this, why should the caller care? If you specify a limit ''in bytes'', it should be because of technical limitation (the buffer being finite long). |
| 9 | What's the ''semantics'' of {{{len}}} here? Is it the number of ''available'' bytes in the output buffer, or is it the number of ''desired'' bytes to fill it up with? You're mixing the two! When thinking in bytes, the number of ''available'' bytes is 64 in the current code, whereas the number of ''desired'' (or ''maximum'') bytes to which to format the string does not make sense. Why would you want to ask the formatter "hey format me this number, I give you a quite large buffer, but make sure not to write more than 11 bytes"? No sense whatsoever. It's the desired UI look you care about, in some locales it'll take 8 bytes, in some it'll take 11, in some it'll take even more. The formatter will know this, why should the caller care? If you specify a limit ''in bytes'', it should be because of technical limitation (the buffer being finite long). |