We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Display imperial units .

terryamy asked
Medium Priority
Last Modified: 2010-04-04
We have a requirement to Display Feet and Inches, it must be displayed in fractions not decimal.

Is there a component which will provide this?
Watch Question


The Question is not on the default units but How can you ensure that the operator inputs a distance in Feet and Inches.

We have Edit Boxes and Mask Edit Boxes is there an component that will take an input of say

       3' 5½"

sorry if the original question was not clear

What about using a mask?

I haven't seen anything specific for this task. As ZifNab says - you should use some kind of a mask-edit-box.

I found some interesting once though:


"TValidatorEdit works like a normal TEdit, except that it validates your inputs while you type. You can specify the characters that may not or may exclusively be entered."


" TFnpNumericEdit is an enhanced version of the standard edit control, that is designed specifically for entering numbers. This component is ideal for data entry applications and other situations where you want to restrict user input to a certain range of numbers. You may specify from 0 to 9 decimals. This component gives you the ability to define minimum and maximum values that are allowed. If an invalid entry is made, an event is fired when the component loses the focus. "

"Number edit."


"SKEdit descended from TEdit. Allows you to only enter numerical values, '.', '-'. Still allows for the use of the delete and backspace keys."


"Five components to work with famous ToolBar97. Contains enhanced TEdit97, TSpin97, TSpinEdit97, TNumEdit97 and TLinkEdit97."



Hope this isn't just a big mass a'crap...


Thank you for the locations I will look at them with interest.

How do the USA operators input FEET and INCHES for there software applications?

I'm not from the US, and inches and feet make dizzy :)

every input I've seen uses decimals...in fact the only place that I've ever sean that you can enter fractions was in Maple.  Maple is a math program for solving complex calculas operation.  If it fits within your user interface you just might want to use two edit boxes with feet and inches.  It might be a cool option (selling point that never really gets used) to have a tricked out graphical entry field that can do fractions but any engineer will use decimals and if they are a scientist they will most likly use the metric system.  When I was in school it was always 9.81 m/s for g.  Never have I used 32 ft/s except to quickly figure out how fast a penny will be traveling after I launch it off a building into the skull of some clueless policeman :)  Actually in a program to track stock prices I saw a edit control that used fractions but it had two spincontrols one that controled the current value and another that controled the amount that would be added or subtracted for the value...so if you wanted to get 5/64 you would put in 1/16 and then 1/64


Thank you  Greedy for your comments.

I agree that they would use decimals if they where Engineers, but I am dealing with Sales personnel!!!! and buyers.

They have stipulated that the Screen needs to be in Feet and Inches and also the drawings produced also in Feet and inches.

My main concern is to provide a clear picture of the data input screen.  I've thought of using four edit boxes arranged to show clearly the feet and inches and possibly create a calculator type form to select with radio buttons. Only ideas but it might work.

Thank you all again.

you could use this code to get the whole number and parts of the fraction.

I droped a edit box, 3 labels and a Button on a new form

procedure TForm1.Button1Click(Sender: TObject);
  MyTempInt: Integer;
    Label1.Caption := Copy( Trim(Edit1.Text), 0, (Pos(' ', Trim(Edit1.Text))-1));
    Label2.Caption := Copy( Trim(Edit1.Text), (Pos(' ', Trim(Edit1.Text))+1), (Pos('/', Trim(Edit1.Text)))-(Pos(' ', Trim(Edit1.Text))+1));
    Label3.Caption := Copy( Trim(Edit1.Text), (Pos('/', Trim(Edit1.Text))+1), (Length(Trim(Edit1.Text))-(Pos('/', Trim(Edit1.Text)))));
    MyTempInt := (StrToInt(Label1.Caption));
    MyTempInt := (StrToInt(Label2.Caption));
    MyTempInt := (StrToInt(Label3.Caption));
    MessageDlg('Damn it, Fix that crap!', mtWarning, [mbOK], 0);

I would probably use a mask and check to make sure that the edit box has a space and a / charicter in it.

You might need some code to ruduce the fractions...ie 2/4 = 1/2

Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.