Posts

How to create a saving calculator.

Image
💰 How to Create a Saving Calculator Function (Installment Savings) Have you ever wondered:  “If I deposit $300 every month at 4% interest, how much will I have after one year?” In this post, we’ll learn how to build a Saving Calculator Function right inside your own programmable calculator app — so you can find the answer instantly without opening a bank app. 🧩 1. Understanding the Saving Formula The general formula for calculating the future value of monthly savings (ordinary annuity) is: FV = PMT × ((1 + r)^n - 1)/r where: PMT = monthly deposit r = monthly interest rate (annual rate ÷ 12 ÷ 100) n = number of months This version assumes the deposit is made at the end of each month, which is how most banks calculate regular savings plans. 💻 2. Creating the Function (End-of-Month Deposit) Here’s the SimpleMath code version for your programmable calculator: def saving(principal, annualRate, months){     var monthlyRate = annualRate / 12/ 100;     var total = p...

🛍️ How to Quickly Calculate Discounted Price with Function Calculator

Image
Have you ever stood in a store thinking: “This item is 30% off… but how much will it actually cost?” Instead of pulling out a normal calculator and pressing buttons again and again, Function Calculator lets you create your own function for this. Once you make it, you can reuse it anytime with just one line. ✨ The Function Here’s a simple function for discount calculation: def discount(price, percent) = price * (100 - percent) / 100; Copy above code in the Factory page and press run button to implement code and press save button to save the function for later use. Here   price = original price percent = discount percentage 💡 Example Usage Imagine a jacket that costs 50 dollars and it’s on 30% sale. Just type: discount(50, 30) ➡️ The result will be: 35 So you’ll pay 35 dollars instead of 50. 🎯 Why It’s Useful No need to re-think formulas every time. Works for any discount rate, not just 30%. You can even combine it with tax calculation if yo...

What Day Will It Be in 100 Days?

Image
What Day Will It Be in 100 Days? Do you want to know what date and day it will be after 10, 50, or even 100 days? With Function Calculator, you can calculate it yourself — no Google needed. 🚀 1. Today’s Date: now() The built-in function now() gives today’s date and time as a 14-digit number. Example: 20250921130330 This means: Year = 2025 Month = 09 Day = 21 Hour =13 Minute = 03 Second = 30 2. Days in Each Month (with Switch) Since our script has no lists, we use switch statements to handle month lengths. ( Copy below code and go to the Factory page in the calculator and paste it. Press run button to implement code and press save button to save your function .) def getDaysInMonth(year, month) {     if (month==1) {          return 31;     } else if (month==2) {          if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {             return 29;         ...

Math function to calculate age.

Image
How to Create an Age Calculator Function in Function Calculator One practical function you can create in Function Calculator is an age calculator. With just a few lines of code, you can calculate a person’s age from their birth year. Step 1 : Understand the now() function In Function Calculator, the built-in function now() returns the current date and time as a 14-digit integer in the format: YYYYMMDDHHMMSS For example: 20250915162430 represents 2025-09-15 16:24:30 (4:24:30 pm). Step 2 : Extract the current year Since the first four digits represent the year, we can isolate them by dividing the number by 10^10 and applying floor(). def year() {     var date = now();     return floor(date / 10^10); } This function takes the 14-digit number from now(), removes the last 10 digits (month, day, time), and leaves only the year. For example: floor(20250915162430 / 10^10) = 2025 Step 3 : Create the age function Now, we can calculate age by subtracting the birth ...

How to create math function that converts decimal number to binary format.

Image
Let's create a mathematical function that converts decimal to binary using the coding function of the function calculator . Copy the code below and paste it into the code window of the function calculator's factory page, click the run button to run the code, and click the save button to save the mathematical function. def toBinary(num) = toBinary((num−num%2)/2)*10+num%2; toBinary(0)=0; toBinary(1)=1; You can go back to the calculator page and press the F2 button to use the function you just created in your calculations as shown below. The above code is defined recursively. The result of the calculation is a decimal number consisting of 1 and 0, which looks like a binary number. In simple terms, the remainder of the given number divided by 2 is placed at the end of the number, and the binary quotient of the division by 2 is placed one digit higher than that. Convert binary to decimal This time we are going to create a math function that converts binary number to deci...

Programming D-Day Using Function Calculator

Image
Mastering D-Day Calculations with Function Calculator With  Function Calculator , users can create custom functions to solve complex problems, including date calculations. At the heart of this capability is the  now()  function , a built-in feature of the app that provides a precise 14-digit timestamp representing the current time. Using this powerful function, users can program their own logic to calculate D-Days (countdowns) and days between dates. In this guide, we’ll explore how you can use  now()  to program your own D-Day functions, complete with examples and practical use cases. Understanding the  now()  Function The  now()  function is a built-in function provided by  Function Calculator . It returns a  14-digit timestamp  in the format  YYYYMMDDHHMMSS , which represents the current date and time down to the second. This serves as the foundation for creating custom date-related calculations. For example: If  n...

Hanoi Tower - How many to move disks.

How to move disks in Hanoi tower : programming example Welcome to the blog post where we showcase the capabilities of our  Function Calculator  by solving one of the most famous problems in computer science and mathematics:  The Tower of Hanoi . This post will introduce how to program to solve hanoi problem. What is the Tower of Hanoi? The  Tower of Hanoi  is a mathematical puzzle consisting of three rods (pegs) and a number of disks of different sizes. The puzzle starts with all disks stacked on one rod in decreasing size, with the largest disk at the bottom. The objective is to move all disks from the source rod to the destination rod, following these rules: Only one disk can be moved at a time. A disk can only be placed on top of a larger disk or an empty rod. You must use an auxiliary rod to assist in moving the disks. Below is code examples that solve hanoi tower problem. You can copy below code and go to the Factory page in the Function Calculator and past...