Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fractions as Select Entries

Status
Not open for further replies.

11791

Programmer
Jan 19, 2000
2
US
I am trying to insert a fraction into a select list (i.e.: 2/3). However, the fraction displays as basic text, not as a fraction. I have tried using <br><br>&lt;select name=&quot;amount&quot;&gt;<br>&lt;option&gt;&lt;sup&gt;2&lt;/sup&gt;/&lt;sub&gt;3&lt;/sub&gt;&lt;/option&gt;<br>&lt;/select&gt;<br><br>to no avail.<br><br>I checked the ascii character set, but it only lists options for 1/2, 1/4, and 3/4 (189, 188 and 190 respectively) as well as the html &quot;&-&quot; type equivalents, i.e.: &frac34; is the equivalent of 3/4. However, I couldn't find an entry for 2/3. I even tried making up one, following the above convention, &frac23; , but this did not work either!<br><br>Anyone having a solution, it would be greatly appreciated!<br><br>Jason
 
I do not believe the browsers (or computers) can evaluate a fractural expression.&nbsp;&nbsp;You need to convert it to decimal format first.&nbsp;&nbsp;But there is no reason your visitors have to know....<br><br>&lt;SELECT&gt;<br>&lt;OPTION VALUE=&quot;.667&quot;&gt;2/3&lt;/OPTION&gt;<br>&lt;/SELECT&gt;<br><br>To the visitor, it's 2/3.&nbsp;&nbsp;To the browser, it's .667.<br><br>Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top