Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Electrical Measurements

Electrical Measurements

How it Works

How Values To Metric Prefixes Conversion Works

The scrip values_to_metric_prefixes converts decimal values to quantities with metric prefixes.  It is similar to the previous example program, but there are two main differences.  First, values_to_metric_prefixes is not using special formatting strings to ensure that the values display as decimal (instead of sometimes displaying exponential notation).  Second, this conversion is the inverse of the previous conversion.  In this script, the value-to-quantity conversion is done with division:

    quantity = value / (10 ** exponent)

In the previous example, the quantity to value conversion was done with multiplication:

    value = quantity * (10 ** exponent)

 

Try This

  • Try expanding the dictionary to include G, n and p, like in the previous example.

 


Did You Know…Scientific Notation?

Since 1 x 103 is 1000, it can also be used in place of the prefix k.  This same rule applies to all rows in the SI Metric Prefixes table on this page..  Just remember to use the rules of scientific notation in your calculations!

(View full size: muam-multiply-by-one-sci-note.mp4)


Your Turn

  • Repeat the R = 1 kΩ and t = 20 ms calculations in Convert Metric Prefixes to Decimal Values but use scientific notation instead.
  • Repeat the f = 38000 Hz and C = 0.000010 F calculations from Convert Quantities to Values with Metric Prefixes but use scientific notation.

 


Printer-friendly version
Convert Quantities to Values
Prev
Script and Tests
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress