A Cheque Amount Converter that converts numerical amounts to both Chinese and English text formats for cheque writing.
Demo: chq.mmc.dev
- Convert numbers to Chinese cheque format (中文大寫)
- Convert numbers to English cheque format (English words)
- Cheque preview with formatted output
- Preset amounts for quick selection
- Conversion history with local storage persistence
- Support for amounts up to HKD/RMB/USD 99,999,999,999.99
- Bilingual interface (Chinese/English) with locale persistence
- URL parameter support for sharing conversions (
?amount=1234.56¤cy=HKD)
- Next.js 16 - React framework
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS 4 - Styling
- Zod - Schema validation
- Vitest - Testing framework
- next-intl - Internationalization
src/
├── components/
│ ├── AmountInput.tsx # Number input component
│ ├── ChequePreview.tsx # Cheque preview display
│ ├── HistoryList.tsx # Conversion history list
│ ├── QuickAmounts.tsx # Preset amount buttons
│ ├── CopyButton.tsx # Reusable copy-to-clipboard button
│ └── LocaleToggle.tsx # Language toggle component
├── contexts/
│ └── LanguageContext.tsx # Language/locale state management
├── domain/
│ └── amount.ts # Shared amount constraints/rounding helpers
├── hooks/
│ ├── useHistory.ts # History management hook
│ ├── useAmountInputState.ts
│ ├── useAmountUrlSync.ts
│ ├── useChequeConversion.ts
│ └── useClipboard.ts
├── schemas/
│ └── amount.ts # Zod schema for amount validation
├── utils/
│ ├── numberToChinese.ts # Chinese number converter
│ ├── numberToEnglish.ts # English number converter
│ └── storage.ts # localStorage access utilities
├── pages/
│ ├── _app.tsx # App wrapper with providers
│ ├── _document.tsx # Custom document
│ └── index.tsx # Main page
└── styles/
└── globals.css # Global styles
Install dependencies:
npm installRun the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Run ESLint with auto-fixnpm run typecheck- Run TypeScript type checkingnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run test- Run tests in watch modenpm run test:run- Run tests once
MIT