locked
how can I show the integer part of the value without any rounding in html RRS feed

  • Question

  • User-1355965324 posted

    I am trying to show the integer part of the decimal value without any rounding, please help

    for example

    7.9 should be shown as 7

    6.2 should be shown as 6

    <div>Max: @Model.consolidated_sales[i].max_sales.ToString("0")</div>
    <div>Min: @Model.consolidated_sales[i].min_sales.ToString("0")</div>
                     

    Thursday, July 16, 2020 7:09 AM

Answers

  • User-821857111 posted
    <div>Max: @(Math.Floor(Model.consolidated_sales[i].max_sales))</div>
    <div>Min: @(Math.Floor(Model.consolidated_sales[i].min_sales))</div>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 16, 2020 7:13 AM