Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

fractions in drop down menus

Hi,

Is it possible to format a dropdown box to display fraction values?

If I have a db value of .33, is there a way to express that in a drop down as a fraction?

Thanks

Bill
0
billium99
Asked:
billium99
2 Solutions
 
kebabsCommented:
0
 
divyeshhdoshiCommented:
Yes,
it is possible ,
dropdown treat source value as a text
simply bind it with datavaluefield and datatextfield
0
 
deaditeCommented:
Yes, here is some simple VBScript that will give you a fraction:


MsgBox Dec2Frac(.33)
 
Function Dec2Frac(topPart)
    count = len(topPart) - InStr(topPart, ".")
    mult = 1
    For i = 1 to count
        mult = mult * 10
    Next
    Dec2Frac = (topPart * mult) & "/" & mult
End Function

Open in new window

0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
Jeffrey CoachmanMIS LiasonCommented:
billium99,

Create a table:

FrationID      Fraction      FractionValue
1      1      1
2      3/4      0.75
3      1/2      0.5
4      1/4      0.25
5      1/8      0.125

Then you can create your combox to *Display* the fraction but *Use* the Value.

Here is a sample with a table and a sample form:
https://filedb.experts-exchange.com/incoming/ee-stuff/6039-Access--EE-Q23007970--Display-f.zip

JeffCoachman
0
 
billium99Author Commented:
Hi - both solutions work - the second one is a slightly better fit for this project.

Thanks for the help guys!
0
 
Jeffrey CoachmanMIS LiasonCommented:
billium99,

I'm glad we were able to help!
:)

JeffCoachman
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now