.Core: int64 support in Format

git-svn-id: svn://ultimatepp.org/upp/trunk@2493 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-06-20 15:40:55 +00:00
parent 4a1b1bfaaf
commit c567bf41cf
2 changed files with 15 additions and 1 deletions

View file

@ -551,6 +551,14 @@ String IntFormatter(const Formatting& f)
return q;
}
String Int64Formatter(const Formatting& f)
{
StringBuffer q;
q.SetLength(1000);
q.SetLength(sprintf(q, '%' + f.format + f.id, (int64)f.arg));
return q;
}
String IntLowerAlphaFormatter(const Formatting& f)
{
return FormatIntAlpha(f.arg, false);
@ -804,6 +812,12 @@ void IntDoubleRegister(int type)
RegisterFormatter(type, "lx", &IntFormatter);
RegisterFormatter(type, "lX", &IntFormatter);
RegisterFormatter(type, "lld", &Int64Formatter);
RegisterFormatter(type, "lli", &Int64Formatter);
RegisterFormatter(type, "llo", &Int64Formatter);
RegisterFormatter(type, "llx", &Int64Formatter);
RegisterFormatter(type, "llX", &Int64Formatter);
RegisterFormatter(type, "e", &FloatFormatter);
RegisterFormatter(type, "E", &FloatFormatter);
RegisterFormatter(type, "f", &FloatFormatter);

View file

@ -110,7 +110,7 @@ delimits the formatter`-id).&]
[s0; &]
[s0; Most printf formatters are supported:&]
[s0; &]
[s0; [* c d i o x X ld li lo lx lX e E f g G s]&]
[s0; [* c d i o x X ld li lo lx lX lld lli llo llx llX e E f g G s]&]
[s0; &]
[s0; Please refer to printf documentation for the description.&]
[s0; &]