Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Measuring decimal places

    Help
    3
    5
    123
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • The_True_Odst
      The True ODST Best Forum Helpers last edited by

      How do you measure how far the decimal place is? (e.g. tenth, hundredth, thousandth place)

      ODST: Orbital Drop Ship Trooper
      (Halo Reference)

      1 Reply Last reply Reply Quote 1
      • info-creaticode
        CreatiCode last edited by

        @the_true_odst

        Can you explain the question with an example? It’s not clear what you are trying to measure.

        The_True_Odst 1 Reply Last reply Reply Quote 0
        • The_True_Odst
          The True ODST Best Forum Helpers @info-creaticode last edited by

          Like if you want to find this decimal (in bold): 0.0001

          ODST: Orbital Drop Ship Trooper
          (Halo Reference)

          info-creaticode jeffreyrb03-gmail 2 Replies Last reply Reply Quote 0
          • info-creaticode
            CreatiCode @The_True_Odst last edited by

            @the_true_odst

            You can ask XO about it. Here is an example prompt:

            write a program to find out the third digit after the decimal point for a number

            1 Reply Last reply Reply Quote 0
            • jeffreyrb03-gmail
              JaecadeJnight Mod Helper @The_True_Odst last edited by

              @The_True_Odst I struggled to understand what you meant at first, but after some re-reading, I can help. So I understand you want to be able to find the decimal number AT any decimal place of any decimal number reliably.
              So, decimal places go like
              0.0001
              (whole number).tenths,hundredths,thousandths,ten-thousandths, hundred-thousandths, millions, etc.

              So we know the bold in 0.0001 is thousandths, but we need a program to do that.
              We’ll just be saying the number of its place instead, like that’s the third decimal place here (3).

              So we need to clean up the number by making it positive (incase its negative), and only focusing on the part after the decimal point, then returning the decimal place based on another input.

              Make a reporter custom block with two inputs then put this code into it:
              64b4716e-d974-4486-abbb-ae682fd1def9-image.png

              It should report the number that exists at a decimal place. So in 0.128456, if you wanted to know the number that resides at thousandths place (3), then you’d do (return decimal place (3) of decimal number (0.128456)) and it would report “8”.

              #LLJW
              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

              1 Reply Last reply Reply Quote 0
              • First post
                Last post