Features

Calculation Precision

Calculation Precision

Negative value means that no rounding is performed. The default value for this property is 14.

Features

CalculationPrecision

The CalculationPrecision gets or sets the number of digits after the decimal point to round to when calculating FlexSheet formulas.

Cell Content:

Calculation precision value:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace FlexSheetExplorer.Controllers
{
    public partial class FlexSheetController : Controller
    {
        // GET: CalculationPrecision
        public ActionResult CalculationPrecision(int val = 14)
        {
            int CalculationPrecision = val;
            return View(CalculationPrecision);
        }

        [HttpPost]
        public ActionResult SetCalculationPrecision(int numb)
        {
            return RedirectToAction("CalculationPrecision", "FlexSheet", new { val = numb});
        }
    }
}
@model Nullable<int>
@section Scripts{
    <script type="text/javascript" src="~/Scripts/FlexSheet/calculationPrecision.js"></script>
}
@section Styles{
    <style>
        .btn {
            margin-bottom: 0;
        }
    </style>
}
@{ 
    int calPrecision = Model != null ? Model.Value : 14;
}
<div>
    <div class="copy">
        <h3>@Html.Raw(Resources.FlexSheet.CalculationPrecision_Text0)</h3>

        <p>@Html.Raw(Resources.FlexSheet.CalculationPrecision_Text1)</p>

    </div>
    <div class="row">
        <div class="col-md-12 col-xs-24">
            <div class="form-inline well well-lg">
                <p><b>@Html.Raw(Resources.FlexSheet.CalculationPrecision_Text4)</b><span id="cellContent"></span></p>
                @Html.Raw(Resources.FlexSheet.CalculationPrecision_Text3)
                <input type="text" class="form-control " value="@Model" id="precisionVal" />
                <button type="button" class="btn btn-default" onclick="setCalculationPrecision()">@Html.Raw(Resources.FlexSheet.CalculationPrecision_Text5)</button>
            </div>
        </div>
    </div>
    <div>
        @(Html.C1().FlexSheet().CssClass("flexSheet").Id("formulaSheet").OnClientSelectionChanged("SetCellContent")
        .AddUnboundSheet("Formulas", 20, 8).CalculationPrecision(calPrecision)
        )
    </div>
</div>
@section Summary{
    <p>@Html.Raw(Resources.FlexSheet.CalculationPrecision_Text2)</p>

}