jeudi 7 avril 2022

How do I break down a number into thousands, hundreds, tens, and one [closed]

I have a math.random function that displays a number between 0-1000. Now I want to display its break down into hundreds, tens, and ones e.g 123, breakdown: 100, 20, 3.

<html>              
               <body>
                               <script>
                                   document.write("Randomly generated number: ");
                                   document.write(Math.floor((Math.random() * 1000) + 0));
                               </script>
               <body>
</html>```



Aucun commentaire:

Enregistrer un commentaire