only get the length of a const string once... it's a minor speedup but still
use a stringstream for the buffer and cache the localized strings... they aren't going to change between calls