Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5974643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:58:16+00:00 2026-05-22T20:58:16+00:00

I am having a section of an application used for converting units from feet

  • 0

I am having a section of an application used for converting units from feet and inches to centimetres.

I accept the feet and inches from the user through two UITextField inputs which works fine. I then want to perform a calculation on the inputted values and display the result in a Label underneath. The code I am using for the calc when the ‘convert’ button is tapped is as follows;

-(IBAction)heighConvertButtonAction:(id)sender {

    NSString *feetCM = heightFeetField.text;
    NSString *inchesCM = heightInchesField.text;

    float fFeet = 30.48 * [feetCM integerValue];
    float fInches = 2.54 * [inchesCM integerValue];
    float fFeetInches = fFeet + fInches;
    fFeetInchesResult = [NSString stringWithFormat:@"%", fFeetInches];

    heightCMLabel.text = fFeetInchesResult;

}

It works in the sense that it doesnt produce any errors, however, when the convert button is touched it doesn’t do anything. I was hoping it would populate the ‘heightCMLabel’ label with the result.

Any help would be appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:58:17+00:00Added an answer on May 22, 2026 at 8:58 pm
    fFeetInchesResult = [NSString stringWithFormat:@"%", fFeetInches];
    

    Not sure if it was just an error when posting your code, but that’s not a valid string formatter.

    Try:

    fFeetInchesResult = [NSString stringWithFormat:@"%f", fFeetInches];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a ruby on rails application.I added a new section called reports
I'm working on a iPhone-application, and within one section the user should be able
I'm having trouble working out how to lock my application out of a section
I am having a problem accessing the @attribute section of my SimpleXML object. When
I am having trouble animating a custom UITableView section header. The goal was to
I am having a problem with that preview tab in network section. When HTML
I'm having problems uploading and even viewing files in the File section of MODX
I'm having problems with the datomic tutorial at the Revisiting the past section http://datomic.com/company/resources/tutorial.html
Good afternoon, I'm having a problem with a section of code I'm working on
I'm trying to display an SWT table inside a form section, but am having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.