Skip to content

Swahili Number to Words in JavaScript (sw-KE, sw-TZ) โ€‹

Use sw-KE or sw-TZ when your application needs Swahili number words for East African invoicing, checkout flows, or documents that print totals in full words.

Locale codes: sw-KE, sw-TZ ยท Numbering system: Short scale ยท Currency: Shilingi / Senti ยท Script: Latin

Install โ€‹

bash
npm install to-words

Basic Conversion โ€‹

js
import { ToWords } from 'to-words';

const tw = new ToWords({ localeCode: 'sw-KE' });

tw.convert(100);
tw.convert(1000);
tw.convert(1000000);

Currency - Shilingi / Senti โ€‹

js
tw.convert(1234.56, { currency: true });
tw.convert('500.00', { currency: true, includeZeroFractional: true });

Tanzania (sw-TZ) โ€‹

js
const twTZ = new ToWords({ localeCode: 'sw-TZ' });
twTZ.convert(1234.56, { currency: true });
// Uses Tanzanian Shilling (TSh)

Ordinal Numbers โ€‹

js
tw.toOrdinal(1);
tw.toOrdinal(10);
tw.toOrdinal(100);

Locale Codes โ€‹

Locale codeCountryCurrencyNotes
sw-KEKenyaShilingi / Senti (KSh)Standard Kenyan Swahili wording
sw-TZTanzaniaShilingi / Senti (TSh)Tanzanian Swahili with TZS currency

FAQ โ€‹

Q: Which locale code should I use for Swahili number-to-words output? Use sw-KE for Kenya. Use sw-TZ for Tanzania.

Q: Does to-words support Swahili ordinal words? Yes. Both sw-KE and sw-TZ include ordinal mappings.

Released under the MIT License.