Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Not sure how to Cast Currency

$
0
0

I have added a 

        [Display(Name = "Replacement Cost")]
        [DataType(DataType.Currency)]
        public float? ReplacementCost { get; set; }

Which is showing as Real in SQL Server.

When I push seed data to it as 

ReplacementCost=f ,

Its throwing an error:

Error	CS0103	The name 'f' does not exist in the current 

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/float

suggests F yet this throws an error:

the name 'F' does not exist in the current context

I am confused.  Is there another reference I am missing or has the Real in SQL requires a different approach?
 


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>