开发者

Number formatting in C#

I am trying to format a number in a GridView that is in pounds into pence.

e.g. 0.0106 to 1.06

Is it possible to archive this with the DataF开发者_开发知识库ormatString on the GridView? Or would it make more sense to do the conversion within the stored procedure?


You like to display the number in the GridView, so convert it as close to the GridView as possible. It is definitely a presentation thing, so do it in that layer of your application.

Using the DateFormatString is correct as this is specifically designed to do what you wish.

Finally, my idea of conversion in the database is that conversion is not something a database was designed for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜