Numbers in Words
The coding kata can be found here.
Problem Description
It occurs now and then in real life that people want to write about money, especially about a certain amount of money. If it comes to cheques or contracts for example some nations have laws that state that you should write out the amount in words additionally to the amount in numbers to avoid fraud and mistakes. So if you want to transfer 745 $ to someone via cheque you have to fill out two fields:
745.00 $ (amount in numbers)
seven hundred and fourty five dollars (amount in words)
Requirements
- Do all of it test driven.
- Write a little converter class or function to convert numbers into words.
- The converter should be able to convert numbers from 0 to 999999.
- Convert it back (optional).
Getting started
- To run the code you can either use the following command (from inside the
numbers-in-words
folder):
go run .
or simply use the debugger (F5
) - To run the tests you can use the following command (from inside the
numbers-in-words
folder):
go test ./...
or simply use the VS Code Testing extension. The test example in this case will fail. Could you correct it? 😉