How to resolve the algorithm Suffixation of decimal numbers step by step in the Phix programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Suffixation of decimal numbers step by step in the Phix programming language

Table of Contents

Problem Statement

Suffixation:   a letter or a group of letters added to the end of a word to change its meaning. Suffixation:   the addition of a metric or "binary" metric suffix to a number, with/without rounding.

Write a function(s) to append (if possible)   a metric   or   a "binary" metric   suffix to a number   (displayed in decimal). The number may be rounded   (as per user specification)   (via shortening of the number when the number of digits past the decimal point are to be used).

would display:

Use whatever parameterizing your computer language supports,   and it's permitted to create as many separate functions as are needed   (if needed)   if   function arguments aren't allowed to be omitted or varied.

Let's start with the solution: