I'm trying to fade a day scene into a night scene

This is the first time I worked with facer, and I love it so far!
I have stumbled upon a problem though.

I have made 2 scenes, a day and a night scene. For some reason this function does not work:
$ (#Da#) == “AM” ? (#Dm#+(60*#DK#))100/720 : -(#Dm#+(60#DK#))*100/720 $

What it needs to do is rescale the minutes in a day to a number between 0 and 100.
Then it checks if it is AM or PM and based on that it decreases or increases the amount of transparency.

So my 2 questions are:

  • Why doesn’t this function output anything?
  • I think the “false” part of the conditional is wrong too, how can I “inverse” the effect of the “true” part?

I tried for hours but I don’t get it. Is it something simple I missed? Am I making this more complicated than it is?

I hope I explained this good enough. If not I’m sorry, please let me know.

Thanks in advance!