Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8970665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:45:49+00:00 2026-06-15T17:45:49+00:00

i used entity framework to get a model from my oracle database and then

  • 0

i used entity framework to get a model from my oracle database and then ADO dbcontext generator to create my classes, the problem is that the “number” fields in oracle were passed as “decimal”, what i want to do is to show them in my tables like integers.

for example i have a cshtml view with a table, and it shows

number_of_prod
123.00

i want it to show it like this:

number_of_prod
123

maybe with [DisplayFormat …..] , but i dont know how to use it XD!..

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:45:51+00:00Added an answer on June 15, 2026 at 5:45 pm

    Simply cast to an int on the page:

    @((int)myDecimal)
    

    You could of course also cast them beforehand. At any rate, casting will truncate any decimal places. If you need to round them then you should use Math.Round().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've used once an downloadable add-on for entity framework, from the internet or Nu-Get
I created an Entity Framework model based on an existing database, then generated the
I used Entity Framework to create my database schema and generate my code. I
I have built up a code-first model using Entity Framework 5. The classes have
I am using attempting to create a connection to an Oracle database via entity
I'm using Entity Framework and MVC3, I have used Model First approch... I have
The Entity Framework context object implements a Dispose() method which Releases the resources used
I used Nuget to update to Entity Framework 5.0.0-beta2 in my MVC3 -> MVC4
I'm trying to use Entity Framework to query database and I have following code
MVC Validation Fundamentals (with Entity Framework) Scenario: I have a model class as below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.