Number() や parseInt() で文字列を数値に変換するときに 0x から始まる文字列は16進数、0から始まる文字列は8進数としてと解釈されます。

trace( Number ("11") ); // 11 ←普通にOK
trace( parseInt("11") ); // 11 ←普通にOK

trace( Number ("000011") ); // 9 ←8進数として解釈された
trace( parseInt("000011") ); // 9 ←8進数として解釈された
trace( parseInt("000011", 8) ); // 9
trace( parseInt("000011", 10) ); // 11 ←10進数で変換するように指示するとOK
trace( parseInt("000011", 16) ); // 17

文字列に小数点を含むと Number() でも10進数として変換してくれます。
trace( Number ("000011.0") ); // 11 ←キタ—!
trace( parseInt("000011.0") ); // 11 ←キタ—!
trace( parseInt("000011.0", 8) ); // 9
trace( parseInt("000011.0", 10) ); // 11 ←どっちでも使える!?
trace( parseInt("000011.0", 16) ); // 17

でも parseInt() は文字列を「整数」に変換する関数なので小数点以下がある文字列に使えません。
trace( Number ("000011.5") ); // 11.5 ←キタ—!
trace( parseInt("000011.5") ); // 11 ←残念...
trace( parseInt("000011.5", 8) ); // 9
trace( parseInt("000011.5", 10) ); // 11 ←残念...
trace( parseInt("000011.5", 16) ); // 17

parseInt("000011", 10)); // ← 整数のときはこれで
Number ("000011.5" ); // ← 少数点があるときはこれ?

そんな時は parseFloat() が使えます。
trace( parseFloat("000011") ); // 11 ←キタ—!
trace( parseFloat("000011.0") ); // 11 ←キタ—!
trace( parseFloat("000011.5") ); // 11.5 ←キタ—!
trace( parseFloat("11") ); // 11 ←キタ—!
trace( parseFloat("11.0") ); // 11 ←キタ—!
trace( parseFloat("11.5") ); // 11.5 ←キタ—!

えぇ、つまり parseFloat() 使ったことがなかった。感動!!って書き込みです。

trace( Number ("0xff") ); // 255 ←キタ—!
trace( parseInt ("0xff") ); // 255 ←キタ—!
trace( parseFloat("0xff") ); // 0 ←残念...

FN0109004 - 0で始まる数値が0に変わってしまう
FN0109005 - 8進数はサポートされているのか

投稿日 : 2007年04月19日 - yoshiweb - カテゴリ: Flash


投稿者 : houston car buyers

You're so awesome! I don't suppose I've read a single thing like that before.
So nice to find another person with a few unique thoughts
on this subject matter. Seriously.. thank you for starting this up.
This web site is one thing that is required on the internet, someone with a little originality!
2022年07月15日 00時21分13秒

投稿者 : bit.ly

It's awesome for me to have a web site, which is useful for
my experience. thanks admin
2022年07月16日 00時25分27秒

投稿者 : t.co

Helpful info. Lucky me I found your website accidentally, and I'm
shocked why this accident didn't came about in advance!
I bookmarked it.
2022年07月22日 21時07分40秒

投稿者 : tinyurl.com

It's truly very complicated in this busy life to listen news on Television, so I only use web for that reason,
and obtain the most up-to-date information.
2022年07月23日 13時52分48秒

投稿者 : http://tinyurl.com/

Hi there! This is my 1st comment here so I just wanted to give a quick shout
out and say I genuinely enjoy reading through your posts.
Can you suggest any other blogs/websites/forums that cover the same
subjects? Thanks a lot!
2022年07月26日 12時27分57秒

投稿者 : tinyurl.com

When someone writes an paragraph he/she maintains the
thought of a user in his/her brain that how a user can know it.
Therefore that's why this article is perfect. Thanks!
2022年07月26日 20時18分32秒

投稿者 : http://tinyurl.com/

My brother recommended I may like this blog. He was once totally right.
This publish actually made my day. You cann't consider simply
how much time I had spent for this info! Thanks!
2022年08月02日 06時12分49秒

投稿者 : tinyurl.com

Quality articles is the main to be a focus for the users to pay a quick visit the site, that's what this website is providing.
2022年08月03日 21時31分28秒

投稿者 : http://wateringcanministry.com/

Great blog here! Also your web site loads up fast! What host are you
using? Can I get your affiliate link to your host?
I wish my website loaded up as fast as yours lol
2022年08月08日 07時24分52秒

投稿者 : http://tinyurl.com/2nlygpm2

I really like your blog.. very nice colors & theme.

Did you create this website yourself or did you hire
someone to do it for you? Plz reply as I'm looking to design my
own blog and would like to know where u got this from.
2022年08月09日 01時49分11秒

投稿者 : http://korbiwiki.de

Hi there! This is kind of off topic but I need some guidance from
an established blog. Is it very hard to set up your own blog?
I'm not very techincal but I can figure things out pretty fast.

I'm thinking about setting up my own but I'm not sure where to start.
Do you have any tips or suggestions? Thank you
2022年08月10日 00時06分41秒

投稿者 : tinyurl.com

Hello, I think your website could be having browser compatibility problems.
When I look at your site in Safari, it looks fine
however, if opening in IE, it has some overlapping issues.
I simply wanted to provide you with a quick heads up!

Aside from that, excellent site!
2022年08月10日 19時18分57秒

投稿者 : coupon

Nice post. I learn something totally new and challenging on websites I stumbleupon everyday.
It's always useful to read articles from other authors and practice a
little something from other web sites.
2022年08月12日 05時52分57秒

投稿者 : http://tinyurl.com/2zb5ww84

I am not sure where you are getting your information, but great topic.
I needs to spend some time learning much more or understanding more.

Thanks for excellent information I was looking for this info for my mission.
2022年08月12日 20時23分52秒

投稿者 : tinyurl.com

Hi! Do you know if they make any plugins to assist with Search Engine Optimization? I'm trying to get my blog to rank
for some targeted keywords but I'm not seeing very good success.
If you know of any please share. Thanks!
2022年08月14日 05時34分16秒

投稿者 : tinyurl.com

What's up Dear, are you really visiting this website daily, if
so afterward you will definitely take pleasant knowledge.
2022年08月14日 09時49分15秒

投稿者 : tinyurl.com

Link exchange is nothing else however it is only
placing the other person's webpage link on your page at
proper place and other person will also do same in support of you.
2022年08月15日 09時48分42秒

投稿者 : http://tinyurl.com/

I visited various web pages but the audio feature for audio songs existing at this web site
is truly wonderful.
2022年08月15日 23時08分15秒