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

  • SEARCH
  • Home
  • 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 8150643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:07:36+00:00 2026-06-06T15:07:36+00:00

I currently have 2 text fields where users enter full numbers, these are then

  • 0

I currently have 2 text fields where users enter full numbers, these are then multiplied together and divided by 100 to get a desired number and shown in a label, i.e. 2400×1200/100=288.
My issue is I require the resulting number to be shown as “2.88” not “288” how can i achieve this?

My code as below

- (IBAction)myTextField:(id)sender {
}

- (IBAction)mySecondTextField:(id)sender {
}

- (IBAction)calculate {
int num1 = self.myTextField.text.intValue;
int num2 = self.mySecondTextField.text.intValue;
self.myLabel.text = [NSString stringWithFormat:@"%.2d m2", num1 * num2 / 10000];
}
  • 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-06-06T15:07:38+00:00Added an answer on June 6, 2026 at 3:07 pm

    Use –

    self.myLabel.text = [NSString stringWithFormat:@"%.2f", num1 * num2 / 10000.0];
    

    instead of 10000, you need to use 10000.0. And only %0.2f is sufficient as format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have in production SQL Server 2005 and we use it's full text
I currently have a text file that has the following: 1 Commercial & Enterprise
I currently have 6 100mb+ PDF documents which have searchable text layer enabled. However
I currently have a small text game I've written in Java that utilizes System.out.print();
Currently I have a a text file with data at the first row is
Currently I am doing this: I have text that looks like: Hello ${user.name}, this
I am currently working on android project where I want to have a text
I have an online text editor, very well made however it does not currently
I have a multi-line text box. When users simply type away, the text box
I have a survey from 100 users and I'm trying to calculate some statistics.

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.