Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 9

Qt-interest Archive, January 2002
Internal number storage


Message 1 in thread

Hello,

I would like to ask a some-what general question. When storing numbers
internally (1,2,3,4.. etc) is it best to store them in ASCII or in
their respective
language's character encoding?

Let me explain. For example, in Arabic, some Arab countries use the
Hindi
number system, and others use the Arabic numerals (thankfully). When
writing an application, should the numbers be stored in their ASCII
encoding,
and then rendered to either Hindi or Arabic at the option of the user,
or should it be stored as Hindi numbers (internally) and then have the
user choose between the Arabic numerals vs. Hindi numerals?

I guess I would like to know how Qt does it because as far as I
understand,
MS stores all digits in ASCII and then renders them according to
lanaguage-
specifics.

Thank you.
Mohammed Elzubeir


Message 2 in thread

On Friday, January 25, 2002, at 03:13 , Moe Elzubeir wrote:

> For example, in Arabic, some Arab countries use the Hindi
> number system, and others use the Arabic numerals (thankfully). When
> writing an application, should the numbers be stored in their ASCII
> encoding,
> and then rendered to either Hindi or Arabic at the option of the user,
> or should it be stored as Hindi numbers (internally) and then have the
> user choose between the Arabic numerals vs. Hindi numerals?

That's kind of an interesting question.

I think in general you'll want to store numbers as numbers, i.e. not in 
Unicode (there are after all no Hindi numerals in ASCII). This not only 
lets you localize to different writing systems, but also to other 
formats. For example, most Americans write "one million" as "1,000,000" 
but many Europeans write "1.000.000" (and I think the British use 
"1,000,000,000" -- oh wait, it's "one billion" they don't understand :-).

David Dunham     A Sharp     david@a-sharp.com
Voice/Fax: 206 783 7404     http://a-sharp.com
Efficiency is intelligent laziness.


Message 3 in thread

On Friday 25 January 2002 23:50, you wrote:
<snip/>
>
> I think in general you'll want to store numbers as numbers, i.e. not in
> Unicode (there are after all no Hindi numerals in ASCII). This not only
> lets you localize to different writing systems, but also to other
> formats. For example, most Americans write "one million" as "1,000,000"
> but many Europeans write "1.000.000" (and I think the British use
> "1,000,000,000" -- oh wait, it's "one billion" they don't understand :-).
>

We (Brits :-) write one million as 1,000,000 and one billion as 1,000,000,000
What's to understand?

Cheers,
Sean
-- 
 [ signature omitted ] 

Message 4 in thread

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 26 January 2002 1:54 am, Sean McGlynn wrote:
> > but many Europeans write "1.000.000" (and I think the British use
> >
>  > "1,000,000,000" -- oh wait, it's "one billion" they don't understand
>  > :-).
>
> We (Brits :-) write one million as 1,000,000 and one billion as
> 1,000,000,000 What's to understand?

The "official" way is (was) to write it as 1 000 000 000 000.

However, writing one billion as 1 000 000 000 is quite frankly more sensible, 
so that tends to be used now :)

- -- 
Cheers, Chris Howells -- chris@chrishowells.co.uk, howells@kde.org
Web: http://chrishowells.co.uk, PGP key: http://chrishowells.co.uk/pgp.txt
KDE: http://www.koffice.org, http://edu.kde.org, http://usability.kde.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8UnTYF8Iu1zN5WiwRApcqAKCdVt31+ZjCOt0YBUEJXsK22+HPEwCfeZ0r
JH116jvs04rWhi2wxnh/DFQ=
=/BxY
-----END PGP SIGNATURE-----


Message 5 in thread

On Saturday 26 January 2002 02:54, Sean McGlynn wrote:
> On Friday 25 January 2002 23:50, you wrote:
> <snip/>
>
> > "1,000,000" but many Europeans write "1.000.000" (and I think the
> > British use "1,000,000,000" -- oh wait, it's "one billion" they don't
> > understand :-).
>
> We (Brits :-) write one million as 1,000,000 and one billion as
> 1,000,000,000 What's to understand?

Well, at least we (germans) use a slightly different scheme :-)

eine Million   = 1 000 000 = 10^6
eine Milliarde = 1 000 000 000 = 10^9
eine Billion   = 1 000 000 000 000 = 10^12
eine Billiarde = 1 000 000 000 000 000 = 10^15

Don't know where this comes from.

Bye,
Bernd


Message 6 in thread


Bernd Brandstetter schrieb:
> 
> Well, at least we (germans) use a slightly different scheme :-)
> 
> eine Million   = 1 000 000 = 10^6
> eine Milliarde = 1 000 000 000 = 10^9
> eine Billion   = 1 000 000 000 000 = 10^12

:-) Almost every European country does that except for the Brits. Almost
every European country writes "," for a decimal point (and actually
calls it a "decimal comma") except for the Brits. Almost every European
country drives on the right except for the Brits. Same as almost any
European country uses metric units of length (metres) whilst the Brits
(and the Americans as well) have their own (feet, inch, yards and
whatnot); the Brits were the ones who disliked °C most so they came up
with °F (though they mainly use °C today, correct me if I'm wrong, but
the U.S. still use °F), and the English speakers call the musical note
below C a "B" while almost everywhere else it's called "H" and the note
below /that/ "B".

Hey, I love the Brits. Honestly, I do!

Arne


Message 7 in thread

<Words language=English type=humour>
:-) :-) :-)
Glad to see you replied in English, like people from all over the world do on 
this mailing list. Perhaps the EU should get rid of all those other silly 
languages that people use and standardise on English only. That would 
simplify life wouldn't it? After all, what's the point of having a single 
currency if you pop over to another country in the eurozone and aren't able 
to ask the price of anything, let alone haggle!?
Or perhaps we should concentrate on a different language. A friend suggested 
this link as a pointer. Should make the Austrian painters of this world happy 
- http://www.unixnerd.demon.co.uk/bmw_rule.html
:-) :-) :-)
</Words>

Cheers,
Sean

On Monday 28 January 2002 16:51, Arne Heizmann wrote:
> Bernd Brandstetter schrieb:
> > Well, at least we (germans) use a slightly different scheme :-)
> >
> > eine Million   = 1 000 000 = 10^6
> > eine Milliarde = 1 000 000 000 = 10^9
> > eine Billion   = 1 000 000 000 000 = 10^12
> >
> :-) Almost every European country does that except for the Brits. Almost
>
> every European country writes "," for a decimal point (and actually
> calls it a "decimal comma") except for the Brits. Almost every European
> country drives on the right except for the Brits. Same as almost any
> European country uses metric units of length (metres) whilst the Brits
> (and the Americans as well) have their own (feet, inch, yards and
> whatnot); the Brits were the ones who disliked °C most so they came up
> with °F (though they mainly use °C today, correct me if I'm wrong, but
> the U.S. still use °F), and the English speakers call the musical note
> below C a "B" while almost everywhere else it's called "H" and the note
> below /that/ "B".
>
> Hey, I love the Brits. Honestly, I do!
>
> Arne

-- 
 [ signature omitted ] 

Message 8 in thread

Arne Heizmann <arne@zn-ag.com> wrote:
>the Brits were the ones who disliked °C most so they came up
>with °F (though they mainly use °C today, correct me if I'm wrong

Fahrenheit didn't seem like a terribly British name, so I just did a 
little checking...

Gabriel Daniel Fahrenheit was German and was living in Holland when he 
developed his temperature scale in 1714, 28 years before Anders Celsius 
developed his alternative system. >;-)

Source
<URL: http://www.athena.ivv.nasa.gov/curric/weather/fahrcels.html>

-- 
 [ signature omitted ] 

Message 9 in thread

Hi Sean

At 01:54 26/01/2002 +0000, Sean McGlynn wrote:
>On Friday 25 January 2002 23:50, you wrote:
><snip/>
> >
> > I think in general you'll want to store numbers as numbers, i.e. not in
> > Unicode (there are after all no Hindi numerals in ASCII). This not only
> > lets you localize to different writing systems, but also to other
> > formats. For example, most Americans write "one million" as "1,000,000"
> > but many Europeans write "1.000.000" (and I think the British use
> > "1,000,000,000" -- oh wait, it's "one billion" they don't understand :-).
> >
>
>We (Brits :-) write one million as 1,000,000 and one billion as 1,000,000,000

1,000,000,000 is an American billion a British billion is 1 million million 
i.e. 1,000,000,000,000.
Using dot could be real confusing, especially when it comes to floating 
point numbers

>What's to understand?
>
>Cheers,
>Sean
>--
>Sean McGlynn
>sean@tmiau.com
>
>--
>List archive and information: http://qt-interest.trolltech.com

Regards
John

-----
john@rygannon.com
http://www.rygannon.com












Message 10 in thread

> 
> We (Brits :-) write one million as 1,000,000 and one billion as 1,000,000,000
> What's to understand?
> 

I thought we Brits wrote "one billion" as 1,000,000,000,000? The "American
billion" of 1,000,000,000 is a "thousand million" .... :-)

Nick


Message 11 in thread

On Saturday 26 January 2002 10:55, Nick Whitelegg wrote:
> > We (Brits :-) write one million as 1,000,000 and one billion as
> > 1,000,000,000 What's to understand?
>
> I thought we Brits wrote "one billion" as 1,000,000,000,000? The "American
> billion" of 1,000,000,000 is a "thousand million" .... :-)
>
> Nick

We only use the 12 zeroes when we're being pedantic or arguing with the 
Yanks... ;-)

/me waves to our American cousins :-)

Cheers,
Sean
-- 
 [ signature omitted ]