Converts Persian words (e.g., "سیصد و پنجاه هزار") into a number.
Persian string describing a number (e.g., "منفی سیصد و دوازده هزار").
Options controlling digit style, commas, and fuzzy replacement.
The converted result as either a string or number, depending on options/digits.
// "سه صد و پنجاه" => 350 wordsToNumber("سه صد و پنجاه"); // 350 // Negative example wordsToNumber("منفی سه صد و پنجاه"); // -350 // With commas and Arabic digits wordsToNumber("یک میلیون و پانصد هزار", { digits: "ar", addCommas: true }); // => "١,٥٠٠,٠٠٠" Copy
// "سه صد و پنجاه" => 350 wordsToNumber("سه صد و پنجاه"); // 350 // Negative example wordsToNumber("منفی سه صد و پنجاه"); // -350 // With commas and Arabic digits wordsToNumber("یک میلیون و پانصد هزار", { digits: "ar", addCommas: true }); // => "١,٥٠٠,٠٠٠"
Converts Persian words (e.g., "سیصد و پنجاه هزار") into a number.