Wednesday, April 19, 2017

MVC razor decimal formatting

Issue:

Trying to get a decimal property of an EF generated model to display more than default 2 decimal place accuracy.

Use N6 as the numeric format string.
myDecimal.ToString("N6");
or
string.Format("{0:N6}", myDecimal);

Source:

http://stackoverflow.com/questions/8412882/c-sharp-show-a-decimal-to-6-decimal-places

1 comment:

  1. Play Coin Casino - Hot or Not? | ChoicesCasino
    Welcome vua nhà cái to ChoicesCasino.com. To 제왕카지노 play our site, log in or create an account, click on 'Join Now' to deposit 코인카지노 and get started.

    ReplyDelete