]> git.tdb.fi Git - libs/core.git/blobdiff - source/fmt.cpp
Add copyright notices and Id tags
[libs/core.git] / source / fmt.cpp
index c9f5d6c70eac16ff071acaf9208d9001925f2993..05f9be5a2decaaa558a5ba30c61b806d41eb5639 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspstrings
+Copyright © 2006-2007 Mikko Rasa
+Distributed under the LGPL
+*/
+
 #include <msp/error.h>
 #include "fmt.h"
 
@@ -32,7 +39,7 @@ void Fmt::apply(ostream &out) const
 {
        out.flags(((base==HEX) ? ios_base::hex : (base==OCT) ? ios_base::oct : ios_base::dec)
                | ((fmode==SCI) ? ios_base::scientific : (fmode==FIXED) ? ios_base::fixed : ios_base::fmtflags(0))
-               | (fillc ? ios_base::internal : (align==LEFT) ? ios_base::left : ios_base::right)
+               | (fillc=='0' ? ios_base::internal : (align==LEFT) ? ios_base::left : ios_base::right)
                | (sbase ? ios_base::showbase : ios_base::fmtflags(0))
                | (spoint ? ios_base::showpoint : ios_base::fmtflags(0))
                | (spos ? ios_base::showpos : ios_base::fmtflags(0))
@@ -93,11 +100,11 @@ void Fmt::parse(const char *f)
        else if(*f=='o')
                base=OCT;
        else if(*f=='e' || *f=='E')
-               fmode=EXP;
+               fmode=SCI;
        else if(*f=='f' || *f=='F')
                fmode=FIXED;
        else if(*f=='g' || *f=='G')
-               fmode=SCI;
+               fmode=EXP;
        else if(*f=='p')
        {
                base=HEX;