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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:48:57+00:00 2026-05-31T00:48:57+00:00

I have a double that I need only the value of everything before the

  • 0

I have a double that I need only the value of everything before the decimal point.

Currently I am using

NSString *level = [NSString stringWithFormat:@"%.1f",doubleLevel];

but when given a value of 9.96, this returns “10”. So it is rounding. I need it to return only the “9”. (note – when the value is 9.95, it correctly returns the “9” value.)

Any suggestions?

Thank You.

  • 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-31T00:48:58+00:00Added an answer on May 31, 2026 at 12:48 am

    Simply assign the float/double value to a int value.

    int intValue = doubleLevel;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help with DataFormatString in GridView. I have a Double value that needs
I have the following code that takes a double value and converts it to
I have an Java-Annotation that return a double value: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface DoubleValue
I have a string value that could contain a double, integer, ascii or byte
I currently have an immutable type called Gene , that only has 2 fields:
If have a union that currently foresees some simple data types: union Value {
Let’s say I have double length that can be either a real length or
I have a specific requirement that all children of a particular JComponent have double
I have a LinqToEntities query that double produces a subquery when creating the SQL.
Here's the c# code that I have: private double get806Fees (Loan loan) { Loan.Fee.Items

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.