A Simple Task

Published by Werdna in

Mubashir needs your help in a simple task.

Create a function that takes a number $n and return its decimal part.

Examples

decimalPart(1.2) ➞ 0.2

decimalPart(-3.73) ➞ 0.73

decimalPart(10) ➞ 0

Notes

  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
Watch a quick demo on how Edabit works.