Help with if statement in repeater

nickCroat 106 Reputation points
2022-12-31T13:48:29.817+00:00

Hi,

How can I add If statement to repeator, this line:
<%# double. Parse(Math.Round((Replace(Eval("VPC"), ".", ",") / 7.5345), 2, MidpointRounding.ToEven)).ToString("0.00") & " €"%>

I need that € in the end of above statement to follow this logic that I could use in default.aspx.vb but not in repeater:
        If CDate(reader("DATUM")) <= CDate("2022-12-31") Then
                strKunaIliEuro = " Kn"
        Else
                strKunaIliEuro = " €"
        End If

Any ideas?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,243 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,564 questions
0 comments No comments
{count} vote

Accepted answer
  1. Viorel 111.8K Reputation points
    2022-12-31T15:43:42.157+00:00

    Try something like this:

    <%# Math.Round(double.Parse(Replace(Eval("VPC"), ".", ",")) / 7.5345, 2, MidpointRounding.ToEven).ToString("0.00") & If(CDate(Eval("DATUM")) <= CDate("2022-12-31"), " Kn", " €") %>

    Probably some adjustments are needed according to other details.


0 additional answers

Sort by: Most helpful