widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #03107
Re: string formatting - integers + leading blanks
-
To:
widelands-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Fòram na Gàidhlig <fios@xxxxxxxxxxxxxxxxxxx>
-
Date:
Fri, 21 Nov 2014 12:56:50 +0000
-
In-reply-to:
<CAGCtC0BitNHfZ=VhTOxhg0hZPo-s4TW6-uWVEUH_MUnPW5dW6g@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
How do we blit the coordinates on the bottom right? You might find some
code to steal there.
21/11/2014 11:52, sgrìobh Tibor Bamhor:
> I cannot make it work. I tested couple of layouts. It even crashed the game.
>
> At the end it is not that critical and perhaps once a branch will be
> created somebody will be able to change it that way
>
> Thanks
>
> 2014-11-21 12:10 GMT+01:00 Fòram na Gàidhlig <fios@xxxxxxxxxxxxxxxxxxx
> <mailto:fios@xxxxxxxxxxxxxxxxxxx>>:
>
> I think the problem might be that boost::format is interpreting the
> numbers as placehloder order. Try
>
> static boost::format node_format("(%1$3i, %2$3i; %3%2i)");
>
> If this doesn't solve your problem, you might find usage examples if you
> grep the code base for boost::format. Otherwise, google for the
> documentation. I know these can be a bit tricky.
>
> Also, we are trying to get rid of "using namespace" statements in the
> long run, so please use "boost::format" rather than just "format".
>
>
>
> 21/11/2014 10:25, sgrìobh Tibor Bamhor:
> > I am trying to use something like this:
> >
> > static format node_format("(%3i, %3i; %2i)");
> >
> > but these numbers are ignored. I noticed that similar code like this
> > '%5.1f' works, what should I use to make it work?
> >
> > Also '%03i' works as intended...
> >
> > Tibor
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~widelands-dev
> > Post to : widelands-dev@xxxxxxxxxxxxxxxxxxx
> <mailto:widelands-dev@xxxxxxxxxxxxxxxxxxx>
> > Unsubscribe : https://launchpad.net/~widelands-dev
> > More help : https://help.launchpad.net/ListHelp
> >
> >
> >
> > No virus found in this message.
> > Checked by AVG - www.avg.com <http://www.avg.com> <http://www.avg.com>
> > Version: 2015.0.5577 / Virus Database: 4213/8604 - Release Date:
> 11/21/14
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~widelands-dev
> Post to : widelands-dev@xxxxxxxxxxxxxxxxxxx
> <mailto:widelands-dev@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~widelands-dev
> More help : https://help.launchpad.net/ListHelp
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2015.0.5577 / Virus Database: 4213/8604 - Release Date: 11/21/14
>
Follow ups
References