- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 06:23 PM
The user enters a specific address in the address field. Then, when the Save button is pressed, the user wants to convert the arithmetic numbers to Chinese numerals and save them ( 5-chome to 五-chome).
Is there a better way to do this?
Thanks, everyone.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 09:05 PM
Hi @sugit
Create On Before BR and use the below script
function arabicToChinese(num) {
const chineseNumbers = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
return num.toString().split('').map(digit => chineseNumbers[parseInt(digit)]).join('');
}
// Assuming 'address' is the field you're working with
address --> replace address with your field name
if (current.address) {
current.address = current.address.replace(/\d+/g, function(match) {
return arabicToChinese(match);
});
}
Please mark this response as Correct and Helpful if it helps you can mark more that one reply as accepted solution.
Thanks
Eshwar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 09:05 PM
Hi @sugit
Create On Before BR and use the below script
function arabicToChinese(num) {
const chineseNumbers = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
return num.toString().split('').map(digit => chineseNumbers[parseInt(digit)]).join('');
}
// Assuming 'address' is the field you're working with
address --> replace address with your field name
if (current.address) {
current.address = current.address.replace(/\d+/g, function(match) {
return arabicToChinese(match);
});
}
Please mark this response as Correct and Helpful if it helps you can mark more that one reply as accepted solution.
Thanks
Eshwar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2024 12:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2024 05:46 AM
Hi @sugit
Please mark this response as Correct and Helpful if it helps you can mark more that one reply as accepted solution.
Thanks
Eshwar