Get first number - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > JavaScript » Get first number


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 03-01-2007   #1 (permalink)
hallo
Member
 
Join Date: Feb 2007
Posts: 45
Default Get first number

I was wondering if it is possible to get the first number of a bigger number. For instance when a variable is 2674, that I can store the first number (in this case "2") and store it in another variable.

Thanx in advance!
hallo is offline   Reply With Quote


Old 04-07-2008   #2 (permalink)
vn4000
Junior Member
 
Join Date: Apr 2008
Posts: 12
Default Re: Get first number

Try convert number to string, for example a = a+ ' ' with a = 2674.
After that use substring method, for example a.substring(0,1)
And convert it to number by parseInt/ parseFloat
Hope that help.
vn4000 is offline   Reply With Quote

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


footer left
All times are GMT. The time now is 03:39 AM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Best Credit Cards | Loans | Books | Personal Car Finance | Cheap hotel in Paris

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49