jeudi 27 octobre 2016

Stuck With if Statement

This is my Code:

 if (haveDataDay) {
    @if (valueDateDay <=100) { 
        valueDateDay.ToString();
    } else if (valueDateDay > 100) {
        @valueDateDay.ToString(valueDateDay % 1 == 0 ? "N0" : "C2")
    }
} else {
    @this.FP("lbl.loader.nodata")
}

Im trying to check if "valueDateDay" has a decimal value of "100 or less" then only change it to string to this line:

valueDateDay.ToString();

and if the "valueDateDay" is bigger than 100 then it need to check this statement and convert it to string:

@valueDateDay.ToString(valueDateDay % 1 == 0 ? "N0" : "C2") }

and if the "valueDateDay" value has no data or equals 0 then get0s to this line:

 else 
        { @this.FP("lbl.loader.nodata") }

however when i run my code my values bigger than 100 are asigned correctly but the values of 100 or less are not saved going directly to :

  else 
        { @this.FP("lbl.loader.nodata") }

what am i doing wrong?

Aucun commentaire:

Enregistrer un commentaire