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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:07:49+00:00 2026-05-18T20:07:49+00:00

For example, getting 5 in 256. The closest I’ve gotten is Math.floor(256/10)), but that’ll

  • 0

For example, getting “5” in “256”. The closest I’ve gotten is Math.floor(256/10)), but that’ll still return the numbers in front. Is there any simple way to get what I want or would I have to make a big function for it? Also, for clarity: “n digit” would be defined. Example, getDigit(2,256) would return 5 (second digit)

  • 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-18T20:07:49+00:00Added an answer on May 18, 2026 at 8:07 pm
    Math.floor((256 / 10) % 10)
    

    or more generally:

    Math.floor(N / (Math.pow(10, n)) % 10)
    

    where N is the number to be extracted, and n is the position of the digit. Note that this counts from 0 starting from the right (i.e., the least significant digit = 0), and doesn’t account for invalid values of n.

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

Sidebar

Related Questions

For example, getting 5 in 256. The closest I've gotten is Math.floor(256/10)), but that'll
There is an example of getting data from form using mapper in official quickstart
I want to extract patterns that appert multiple times in a string. For example,getting
Say for example you're getting a web app project that interacts with a database.
When trying to compile GNU software on HP-UX (binutils for example) I'm getting error
I'm getting the following from a third party library (one example): @%SystemRoot%\SomePath\SomeFile.Dll,-203 I know
Every example I see seems to be for recursively getting files in subdirectories uses
I'm following this example: http://www.codinghorror.com/blog/2005/12/getting-started-with-indexing-service.html However, the conversion to dataset shows empty columns for
I am getting to know boost::variant. I think this example should work. #include <boost/fusion/sequence.hpp>
I am getting some open/closed times as integers since midnight. For example: 1140 =

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.