[SOLVED] Type conversion error

I use ephemeris to calculate the next birtday in days

val String nextBirth = Ephemeris.getNextBankHoliday('/etc/openhab2/services/Birthdays.xml')
        val long untilBirth = Ephemeris.getDaysUntil(nextBirth, '/etc/openhab2/services/Birthdays.xml')

And i wanna display it with

Number number_emphemeris_daysuntilnextbirthday "Nächster Geburtstag in Tagen [%.0f]" 

But nothing is displayed whats wrong??

Anything shows up in the logs?

If nothing shows up, add logging so you can see what the call the getNextBankHoliday returns as well as what getDaysUntil returns.

As an aside, avoid the use of primitives as much as possible. This might actually be the problem as I doubt that getDayUntil returns a long.

I haven’t seen any error only `Err is displayed

I quests it is because a long is returned and I want to display a integer number. Question is how do I cast it the correct way?

In general, don’t. There are very few situations where you need to explicitly cast anything in Rules DSL and when you try to do it yourself it often causes problems. The only time you need to and should mess with primitives is when you are calling something that requires a primitive (e.g. now.plusMinutes), in which case call .intValue on the Number. By default, Rules DSL will convert everything to a Number object for you. Let it.