View previous topic :: View next topic |
Author |
Message |
John
Joined: 17 Jan 2006 Posts: 75
|
Posted: Thu Jan 19, 2006 12:07 pm Post subject: Numeric formating |
|
|
I've been working on a locale library which Kris is interested in adding to Mango. It'll include a number formatting module, using the selected locale's currency and numeric patterns. As potential stakeholders, I wanted to ask people which of the following forms you'd prefer to access these functions with:
Code: | char[] s = Number.format(1234, "N"); |
Or,
Code: | char[] s = formatNumber(1234, "N"); |
(Each of these prints "1,234.00" for UK/US, "1.234,00" for Germany, "1'234.00" for Switzerland and so on.)
The only difference is that the second style is a free function, while the first is a static member of an abstract, non-inheritable class. I'm not sure what the current preference is in Mango regarding static class v free methods, although Phobos tends towards the latter. I prefer the first form, and it is consistent with the rest of the package (where free functions aren't appropriate), so for that reason I'll probably depart from D's predominent style.
But what do you guys think? I could be persuaded to change my mind.
John. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Thu Jan 19, 2006 12:30 pm Post subject: |
|
|
My tuppence ha'penny:
The first instance: Number.format() |
|
Back to top |
|
|
teqdruid
Joined: 11 May 2004 Posts: 390 Location: UMD
|
Posted: Fri Jan 20, 2006 8:36 am Post subject: |
|
|
The first one. Consistency with the rest of Mango is important.
~John Demme
(What is is about D that seems to attract people with the name John?) |
|
Back to top |
|
|
John
Joined: 17 Jan 2006 Posts: 75
|
Posted: Fri Jan 20, 2006 9:46 am Post subject: |
|
|
Quote: | Consistency with the rest of Mango is important. |
Yip, and it looks cute too. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Fri Jan 20, 2006 3:16 pm Post subject: |
|
|
John and John, I'm just resigned to fact that this world is full of people bearing that name!
Reverently,
John |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Fri Jan 20, 2006 3:38 pm Post subject: |
|
|
Must be a western/northern hemisphere thing? In Australia, apparently everyone is called either Bruce! or Sheila!
What appear to be real Names (like Derek Parnell) are just clever nicknames instead, intended to confuse Pommies, Yanks, and various other lesser mortals |
|
Back to top |
|
|
John
Joined: 17 Jan 2006 Posts: 75
|
Posted: Fri Jan 20, 2006 10:30 pm Post subject: |
|
|
Surprisingly, John isn't the most common name in the English-speaking world. Nor even here in the UK. According to the Office of National Statistics, John started to fall out of favour in the 1960s, and lately others have taken over, with Jack, Joshua and Thomas being the top three. In 2005, John ranked a lowly 73rd, below even Harley and Alfie.
Parents aren't too creative when it comes to naming their offspring. But when they try, the results can be comic. In the US, Lexus has appeared in the top 1000 every year since 1993.
Then there are the parents who don't think of the consequences of the name they saddle their children with. Like mine, for example. Surely they weren't sober when they christened me with the rather feminine-sounding first name that led to all sorts of confusion (and puns on male genitalia) at school.
I've since switched my first and middle names, and hence am now a common (though not as common as you'd think) John.
John [second name withheld] C. |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Fri Jan 20, 2006 11:10 pm Post subject: OT: Names |
|
|
John wrote: |
Parents aren't too creative when it comes to naming their offspring. But when they try, the results can be comic. In the US, Lexus has appeared in the top 1000 every year since 1993.
|
Well, I hear the british are among the worst here, as two families with last names Castle and Beer (!), called their sons, respectively, Windsor and Bottled.
My name has the same status in Norway as John in England, btw. Popular before, now only common. |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Mon Jan 23, 2006 3:10 am Post subject: Re: OT: Names |
|
|
larsivi wrote: | John wrote: |
Parents aren't too creative when it comes to naming their offspring. But when they try, the results can be comic. In the US, Lexus has appeared in the top 1000 every year since 1993.
|
Well, I hear the british are among the worst here, as two families with last names Castle and Beer (!), called their sons, respectively, Windsor and Bottled.
My name has the same status in Norway as John in England, btw. Popular before, now only common. |
And what about the guy who started the LearJet company (a certain Mr Lear) who called his daughter "Chanda" ?
|
|
Back to top |
|
|
John
Joined: 17 Jan 2006 Posts: 75
|
Posted: Mon Jan 23, 2006 8:11 am Post subject: |
|
|
More from the department of funny names: the B-movie actor Rip Torn. And no discussion of this kind can pass without a mention of the legendary Thomas Crapper, who, contrary to popular myth, didn't invent the flushing toilet, nor does the profanity derive from his name (it was in use at least 400 years before his birth).
John C. |
|
Back to top |
|
|
gileadis
Joined: 04 Jan 2006 Posts: 5
|
Posted: Tue Jan 24, 2006 1:00 pm Post subject: Re: OT: Names |
|
|
kris wrote: | larsivi wrote: | John wrote: |
Parents aren't too creative when it comes to naming their offspring. But when they try, the results can be comic. In the US, Lexus has appeared in the top 1000 every year since 1993.
|
Well, I hear the british are among the worst here, as two families with last names Castle and Beer (!), called their sons, respectively, Windsor and Bottled.
My name has the same status in Norway as John in England, btw. Popular before, now only common. |
And what about the guy who started the LearJet company (a certain Mr Lear) who called his daughter "Chanda" ?
|
I had a friend who was a teacher. When reading the roll the first day, she got to "Shithead" and it took her a moment to work up the courage to call the name. "It's pronounced Shi-THADE!" shot back the irate student. Poor girl! |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Tue Jan 24, 2006 1:10 pm Post subject: |
|
|
Years ago I was on my way to talk with a therapist my HMO allocated to me. I followed the directions to the professional building, and went about looking up the doctor's name on the leger/index posted in the lobby; to make sure that I had the right place and room number.
While browsing past all the different companies and professionals, one stuck out like a sore thumb.
Harry Beaver, OBGYN.
I asked around, and learned that this wasn't a prank. The guy's legit. _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Tue Jan 24, 2006 1:46 pm Post subject: |
|
|
pragma wrote: | While browsing past all the different companies and professionals, one stuck out like a sore thumb ... |
I had a similar experience when going to a new Dentist in Aberdeen, Scotland ~ the sign on the wall noted one "Dr Pane" ~ luckily, that was the dentist next door to where I was going. |
|
Back to top |
|
|
|
|
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
|