| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A web application that converts numerical currency values into their written word representation.
Input: 123.45
Output: ONE HUNDRED AND TWENTY-THREE DOLLARS AND FORTY-FIVE CENTS
git clone https://github.com/NathanPerrier/NumberToWords.git
cd NumberToWordscd code
dotnet restore
dotnet builddotnet run --launch-profile httpThe application will start and be available at:
curl -X POST "http://localhost:5122/api/conversion/convert" \
-H "Content-Type: application/json" \
-d '{"value": "123.45"}'NumberToWords/ ├── code/ # Main application code │ ├── Controllers/ # API controllers │ ├── Services/ # Business logic services │ ├── wwwroot/ # Static web files │ │ ├── index.html # Main web interface │ │ ├── css/ # Stylesheets │ │ └── js/ # JavaScript files │ ├── Program.cs # Application entry point │ └── NumbersToWords.csproj # Project configuration ├── DESIGN_APPROACH.md # Design decisions document ├── TEST_PLAN.md # Testing strategy document └── README.md # This file
Endpoint: POST /api/conversion/convert
Request Body:
{
"value": "123.45"
}Success Response:
{
"success": true,
"words": "ONE HUNDRED AND TWENTY-THREE DOLLARS AND FORTY-FIVE CENTS",
"originalValue": "123.45"
}Error Response:
{
"success": false,
"error": "Invalid format. Please enter a valid number (e.g., 123.45)"
}Endpoint: GET /api/conversion/health
Response:
{
"status": "healthy",
"timestamp": "2024-01-20T10:30:00Z"
}dotnet run --launch-profile httpsAccess at: https://localhost:7124
Currently, manual testing is performed using the TEST_PLAN.md document. Unit tests can be added by creating a test project:
dotnet new xunit -n NumbersToWords.Tests
dotnet sln code/NumbersToWords.sln add NumbersToWords.Tests/NumbersToWords.Tests.csprojIf you see an error about port 5122 being in use:
Ensure you have .NET 8.0 SDK installed:
dotnet --version| Back | FazBrowse Home | New Git URL |