DataAnnotations to support multiple currencies RRS feed

  • Question

  • User-1026607185 posted

    Hi ,

    I have defined my data under my view  model as follows , 

    [DisplayName("Product Price"), DataType(DataType.Currency)]
    public decimal ProductPrice { get; set; }

    and it display like      <label for="YearlyCost">Product Price </label> : £700.52   

    but I wasnted display the above data like   :  <label for="YearlyCost">Product Price </label> : $ 1200.45   when some one view the site in USA , or supporty multple currencies based on the countries you logged in , 

    please let me the best approach to do this 


    Friday, November 9, 2018 12:50 PM


  • User-1026607185 posted
    I managed to do with below code. 

    <globalization culture="auto" uiCulture="auto"/>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 9, 2018 2:06 PM

All replies