Michael Malone
2/19/2009 12:56:00 AM
Guillaume Loader wrote:
> Hello everyone!
>
> Do you have a better way to do this ?
>
> sentence = "Your ticket has expired since #{nb_of_days if nb_of_days<0}
> #{'days' if nb_of_days<0} #{'today' if nb_of_days==0}"
>
> My goal is to print something like this : "Your ticket has expired since
> 4 days" or "Your ticket has expired since today"
>
>
> I've tried this :
>
> sentence = "Your ticket has expired since #{nb_of_days + 'days' if
> nb_of_days<0} #{'today' if nb_of_days==0}"
>
> But it doesn't work!
>
> Thank you for your help :)
>
I think you want to change that to a greater than...
sentence = "Your ticket has expired since #{nb_of_days + ' days' if
nb_of_days > 0}#{'today' if nb_of_days==0}"
And if that message is going to be read in English, then you should change it to '#{nb_of_days} ago' || 'today' without the since. i.e.
'Your ticket expired 4 days ago' or 'Your ticket expired today'
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================