Persian number - Forum

Forum Navigation
You need to log in to create posts and topics.

Persian number

Hi luishp,

I used the below command and it works good, but I want the number be in English format.

dtLocalDate [NAB.Year] [NAB.MonthNum] [NAB.DayNum] [x] "fa-ir"

Example: I want instead of this (۱۳۹۸/۱۲/۱۰ ) =>(1398/12/10)

Uploaded files:
  • You need to login to have access to uploads.

Hi luishp, I made a sample plugin to convert date Gregorian to Solar Hijri last night, the command is:

convertDateToSolarHijri 2020 3 2 [r]

It works perfect but when I use instead of number special variable, it does not work, like below:

convertDateToSolarHijri [NAB.Year] [NAB.MonthNum] [NAB.DayNum] [r]

How should I do?

Uploaded files:
  • You need to login to have access to uploads.

Hi @asmat, for any reason the year, month a day numbers are not numbers but strings. Just try this:

ToNumber "[NAB.Year]" [Year]
ToNumber "[NAB.MonthNum]" [Month]
ToNumber "[NAB.DayNum]" [Day]
convertDateToSolarHijri [Year] [Month] [Day] [r]
StringifyJSON [r] [result]

Regards.

asmat has reacted to this post.
asmat

Thank you so much luishp.

@asmat note that you can do the conversion in the plugin using "parseInt()".
Regards.