aleczandru
aleczandru

Reputation: 5459

Display currency format

I am trying to display some currency with the Euro symbol. It seems I am doing something wrong because it is not working. This is my code:

[DisplayFormat(DataFormatString="{0:N}")]
public decimal Price { get; set; }

This is how it is curently displayed: 9.9900.

This is how I would like it to be displayed : €9.99

What am I doing wrong and how can I correct it?

Upvotes: 1

Views: 162

Answers (1)

Coding Flow
Coding Flow

Reputation: 21881

use the currency formatter e.g.

[DisplayFormat(DataFormatString="{0:C}")]
public decimal Price { get; set; }

Upvotes: 2

Related Questions