为什么波斯语不添加一个数字?

发布于 2025-02-13 01:26:08 字数 1025 浏览 2 评论 0原文

我在Java脚本中有一个非常奇怪的问题。 查看这些代码并运行该应用程序:

const number = 200000;
const persianMoney = "تومان";

//pay attention to these lines:
console.log("way 1:");
console.log(number + persianMoney);
console.log(persianMoney + number);

console.log("way 2:");
console.log(`${number}${persianMoney}`);
console.log(`${persianMoney}${number}`);

console.log("way 3:");
console.log(String(number) + persianMoney);
console.log(persianMoney + String(number));

console.log("way 4:");
console.log(`${String(number)}${persianMoney}`);
console.log(`${persianMoney}${String(number)}`);

console.log("way 5:");
console.log(String(number + persianMoney));
console.log(String(persianMoney + number));

所有输出都是相同的!所有输出均为200000码}!但是,为什么在某些输出中200000不在200000后面Word word ?即使在这里,我也不能在200000后面放置}تم>!但是为什么这样呢?我听不懂。我以5种方式测试了串联,但它们都不正确!我该如何解决这个问题?感谢您的帮助。

i have a really strange problem in java script.
look at these codes and run the app:

const number = 200000;
const persianMoney = "تومان";

//pay attention to these lines:
console.log("way 1:");
console.log(number + persianMoney);
console.log(persianMoney + number);

console.log("way 2:");
console.log(`${number}${persianMoney}`);
console.log(`${persianMoney}${number}`);

console.log("way 3:");
console.log(String(number) + persianMoney);
console.log(persianMoney + String(number));

console.log("way 4:");
console.log(`${String(number)}${persianMoney}`);
console.log(`${persianMoney}${String(number)}`);

console.log("way 5:");
console.log(String(number + persianMoney));
console.log(String(persianMoney + number));

all of the outputs are the same!! all of the outputs are 200000تومان! but why word تومان is not behind 200000 in some outputs? even here, i cant put تومان behind 200000! but why it is like that? i cant understand it. i tested concatenation in 5 ways but none of them were correct! how can i solve this problem? thanks for helping.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倥絔 2025-02-20 01:26:09

raymand chen 。我的理解是,您希望在数字200000之后拥有货币名称码。将阿拉伯语/波斯语单词保持在与拉丁语IE相同的方向上,沿从左到右的LTR方向。

一种可能的方法是添加LTR代码\ U200E

const number = 200000;
const persianMoney = "تومان";
const ltr = "\u200E";
console.log(persianMoney + ltr + " " + number);

As stated by Raymand Chen. My understanding is that you want to have the currency name تومان after the number 200000. To keep the Arabic/Persian word in the same direction as the Latin word i.e. in a Left-To-Right LTR direction.

One possible way to do that is to add the LTR code \u200E

const number = 200000;
const persianMoney = "تومان";
const ltr = "\u200E";
console.log(persianMoney + ltr + " " + number);

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文