Chapter

Simple Math Module

Simple Math Module

In Yahoo Pipes, the Simple Math Module is a calculator that can do:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Modulo (the remainder of division of one number by another)
  • Powers (the product obtained by multiplying a quantity by itself one or more times)

Numbers can be wired in from other modules or entered directly.

This module has many uses. It can be used to show a certain amount of results in a feed, adding or subtracting dates and times, performing calculations on inputted data, and more.

In this example lets pretend we are selling tickets on the popular site Stubhub. Now Stubhub charges a 15% fee for every ticket that sells on their site. So with the Simple Math Module we can calculate how much commission will be taken off. (I realize this can be done with a plain old calculator, but the beauty of Yahoo Pipes is that we can take this calculation and perform even more actions on it to create a highly functional Pipe).

Tip! The Number Module will not except characters beside 0-9. No $, or any other characters allowed.

Lets use a Number Input Module to input the price of our tickets we want to sell.

Simple Math Module

And wire it into the Simple Math Module to perform our calculation. Because we want to calculate 15% of our ticket price (285) we’ll multiply it by 0.15. We can use the dropdown list to select our mathematical function we want to use.

Simple Math Module

As you can see, Stubhub will charge us $42.75 to sell our ticket. Yikes! Now if we wanted to, we could take this number and process it further with different modules.

0 Comments ↓

No comments yet.

Leave a Reply