FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

variable width format specifiers

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Tue May 23, 2006 9:33 pm    Post subject: variable width format specifiers Reply with quote

Same question I asked in the ng: how is this C code translated to D using Mango?
Code:

        int l = 8, d = 4;
        double v = 34.289;

        sprintf (buf, "?*.*g", l, d, v);
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Tue May 23, 2006 9:54 pm    Post subject: Reply with quote

indirect width is not currently supported by Mango float-format
Back to top
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Wed May 24, 2006 6:07 am    Post subject: Reply with quote

kris wrote:
indirect width is not currently supported by Mango float-format

Too bad. Will it be supported?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Wed May 24, 2006 10:05 am    Post subject: Reply with quote

Carlos wrote:
kris wrote:
indirect width is not currently supported by Mango float-format

Too bad. Will it be supported?

While indirect-precision is not supported via printf-formatting, it can be provided to Double.format() instead
Back to top
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Wed May 24, 2006 11:23 am    Post subject: Reply with quote

kris wrote:
Carlos wrote:
kris wrote:
indirect width is not currently supported by Mango float-format

Too bad. Will it be supported?

While indirect-precision is not supported via printf-formatting, it can be provided to Double.format() instead

Works great! Thanks!
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group