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 8387041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:06:30+00:00 2026-06-09T18:06:30+00:00

So I am working on a tip calculator as my first self guided iOS

  • 0

So I am working on a tip calculator as my first self guided iOS app and I want to be able to output to the UILabel that shows the bill with currency format. As an example, user presses 1, label shows $0.01, user then enters 2, label shows $0.12, user enters 3, label shows $1.23 and so on. Currently I am getting input and updating the display from UIButton’s that have the numbers on them like this:
NSString *digit = sender.currentTitle;
self.display.text = [self.display.text stringByAppendingString:digit];

I have read several questions on here about number formatting and tried the solutions but cannot get anything to work, but most of the solutions were for UITextFields, so I am thinking perhaps there is a problem with how I am getting input? Any help would be greatly appreciated.

*to clarify, what I am going for is speed. I have a decimal button and have the display with the $ sign, but I want to get rid of the decimal button so all the user has to do is punch in the numbers and not even worry about putting the decimal.

  • 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-09T18:06:32+00:00Added an answer on June 9, 2026 at 6:06 pm

    Here’s an idea, why not store the number in cents/pennies – i.e the smallest possible value for a currency. That way if the user presses another number you can simply multiply the existing number by 10 and add the new number.

    An example:

    • User presses 1 => Number was 0 before, so new number is 0 * 10 + 1 =
      1
    • User presses 2 => Number was 1 before, so new number is 1 * 10 + 2 =
      12
    • User presses 3 => Number was 12 before, so new number is 12 * 10 + 3
      = 123

    Now to display this, all you have to do is divide the number by 100 (or whatever is suitable for the given currency) and use the result in a string with format %0.01f

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

Sidebar

Related Questions

I am working on an iOS app that is basically a tip of the
How can I change my tool-tip so that it has a working auto width.
I'm developing a Facebook app for the web application that I'm working on. I
All- I am working on an app in which the user enters the bill
I working on an android app that has already been built, and i am
I have the following script that is working great, but I want to wrap
Working with an undisclosed API, I found a function that can set the number
Working with MS Access for the first time and coming across a few problems
Have been using a simple CSS only tooltip. Working Example css: .tip { position:relative;
I'm working on a live server. I've updated to tip and it's caused problems:

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.