Slogbox
Search & Comment
  

 
 
Slog about how to make round input boxes   
Comments    
 
Your name

* Please enter your name

Your comment

* Please enter your comment

Notify me on replies to:

*Please enter your email

*Please enter a valid email

 
 

how to make round input boxes by
Now
how to make round input boxes by richarduie
The content (value) returned by prompt() is of the String type. You're using parseInt() on the value, and it's working exactly correctly, i.e., it's reading numeral String up to the first non-numeral character and converting it to an Integer. What you should be using for decimal input Strings is parseFloat() NOT parseInt().

For fractions of the form {m/n},recognize that the {/} is an operator (a non-numeral character), and parse*() functions aren't appropriate. You need to evaluate the expression, using the eval() function.
June 29, 2009 | 2:49 am | Report abuse | Reply
how to make round input boxes by P.S.P.
I have several questions on avoiding JavaScript rounded calculations on information (integers/numbers) from prompt boxes, and then with entering fractions in prompt boxes where prompt boxes always ignores the denominator of fractions that's put in. (i.e. if I put in 2/5 in a prompt box then convert it to integer, javascript will count that as 2, which is nowhere near 2/5!)

So, I'm still working around making some calculators with JavaScript, I got the basics down to make these calculators work efficiently. On one of my calculators, it is the slope calculators:

For example, if I want to calculate the slope of a line, my calculator would give me decimals as the result, it's ok, but if I want to just get the regular fractions returned instead of decimals how can I do that with JavaScript?

Also, using the prompt box to collect information from user, then converting that information to integers using parse.Int(), it always automatically rounded fraction to the nearest ones, which I don't want either.

For example, if I put in 2.4 in a prompt box, it will return as 2, which is bad for full calculation, how can I make prompt boxes return integer information as what it is without rounding it?

Then, even worse if I put in fractions in prompt box, it always ignores then denominator of it. For example, if I have a fraction of 10/0 JavaScript thinks of it as just 10, when it should be undefined! Same with regular denominator, if I put in 10/2 Javascript will still think of it as 10.

All of these is user input using the prompt boxes, which later I convert to integers with parse.Int()

Help would be greatly appreciated for fixing all of these problems that I don't want. Thanks!
June 28, 2009 | 9:22 pm | Report abuse | Reply

Agrega tu comentario


Tagged as
  Add-ons , Hunting , MySpace , TVs

All Categories

 


Slogs related to how to make round input boxes
 
how to make raspados
make a simple syrup with sugar and water then blend fruits in blender with water...
by Jackie | Reply
 
how to make a command collar
Sure you could get your fox a collar! I know someone who take her pet bunny for ...
by Liz | Reply
 
 
 
how to make my bf worship me
I know you have probably heard this a million and one times before in your life ...
by Hannah | Reply
 
how to make olive nail polish
paint thinner
by Veronica M | Reply
 
 
 
how to make a sweater for dog/
I am a big fan of etsy.com. Sometimes you can find pdf patterns on there for a ...
by Jillian | Reply
 
how to make black shoes grey
Both those answers before me are assuming you have a photo editing program such ...
by picsnap | Reply
 
 
 
how to make fun wagers
Being completely objective I would have to say that they will probably make the ...
by Shack | Reply
 
how to make a sweater for dog
PetCareRx.com www.doggoneknit.com/ Try these sites..................
by Allie | Reply
 
 
 
how to make vanilla raspados
hahahah. Are you like addicted to them or something? you say it like if...
by Darth Twiggy | Reply
 
how to wear make up with a navy dress
Try useing a babyblue eye shadow,with a dark eyeliner on your upper eye lid to m...
by lynnetta8211 | Reply
 
 
 
how to make raspado
http://www.yo...
by Krystal Alley | Reply
 
how to make a raspado
Wikipedia have the answer
by CYNTHIA | Reply
 
 
 
ubuntu how to make the access from wi
Must use FAT32 to support both of those systems. Find a Windows 98 sys...
by mrboo40 | Reply
 
how to make taupe walls stand out
So if I help you write this book by giving you my plot ideas, will you give me c...
by Alice2384 | Reply
 

All related

 

 

 



 
Semantic refine:


Don't skimp on the equipment. Practice practice practice
www.slogbox.com
recommend
You are not going to make that at home. Go to a a mexican food store
www.slogbox.com
recommend
Okay, you have the bamboo thing going on, so how about a grass-type mat for your
www.slogbox.com
recommend
Searching...



Ver resultados en otros idiomas
   
  
My slogs
 
Your email:
 
Wait
Add your comment
Thank you for helping us improve the quality of this site.
Reply    
 
Your name

* Please enter your name

Your comment

* Please enter your comment

Notify me on replies to:

*Please enter your email

*Please enter a valid email

 
*Please enter your name
how to make round input boxes by
*Please enter your email
*Please enter a valid email
Notify me on replies to 
 
Español   |   English   |   Português   |   Русский   |   Contact us
All opinions expressed here belong to the authors and do not necessarily reflect the opinions of Slogbox.com