יש לי את הקוד הזה:
function numberBelowThousandToWords(num) {
let words = [];
if (num >= 100) {
words.push({ type: 'file', data: `/ivr_records/${hundreds[h]}` });
num %= 100;
if (num > 0) words.push({ type: 'file', data: `/ivr_records/${num}` });
} else {
words.push({ type: 'file', data: `/ivr_records/${num}` });
}
return words;
}
export function numberToHebrewWords(num) {
if (num === 0) return [{ type: 'file', data: `/ivr_records/0` }];
let words = [];
// מיליון
if (num >= 1_000_000) {
const millions = Math.floor(num / 1_000_000);
if (millions === 1) {
words.push({ type: 'file', data: `/ivr_records/מיליון` });
} else if (millions === 2) {
words.push({ type: 'file', data: `/ivr_records/שני מיליון` });
} else {
words.push(...numberBelowThousandToWords(millions));
words.push({ type: 'file', data: `/ivr_records/מיליון` });
}
num %= 1_000_000;
}
// אלפים
if (num >= 1000) {
const thousands = Math.floor(num / 1000);
if (thousands === 1) {
words.push({ type: 'file', data: `/ivr_records/אלף` });
} else if (thousands === 2) {
words.push({ type: 'file', data: `/ivr_records/אלפיים` });
} else if (thousands < 100) {
// מספר <100 נשאר כמו שהוא
words.push({ type: 'file', data: `/ivr_records/${thousands}` });
words.push({ type: 'file', data: `/ivr_records/אלף` });
} else {
// מעל 100 → מאות + שאר <100
words.push(...numberBelowThousandToWords(thousands));
words.push({ type: 'file', data: `/ivr_records/אלף` });
}
num %= 1000;
}
// מאות + שאר <1000
if (num > 0) {
words.push(...numberBelowThousandToWords(num));
}
return words;
}
let ad1 = `המודעה היא דירה ל${buyorrent} ב${city}`;
let ad2 = ` טלפון ליצירת קשר ${phone} `;
/*************************************************************************************** */
// שאלת עריכה
while(await call.read([{type: 'text', data: `${ad1} `},...numberToHebrewWords(price),{ type: 'text', data: `${ad2} , לעריכת המודעה הקש 1 לפרסום ושמירה 2` }], 'tap', {
max_digits: 1,
min_digits: 1,
typing_playback_mode: "No",
digits_allowed: [1,2]
מישהו יכול להסביר לי למה התוצאה היא
read=t-[object Object],[object Object],[object Object],[object Object],[object Object].t-לאישור הקישו 1 להקשה מחודשת
2=val_17,no,,1,2,No,no,no,,1.2.*0,,,None,
במקום מה שאמור להיות?