# GrapeCity.CalcEngine.IEvaluationContext.CastToLong

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_CalcEngine_IEvaluationContext_CastToLong_" data-uid="GrapeCity.CalcEngine.IEvaluationContext.CastToLong*">CastToLong Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_CalcEngine_IEvaluationContext_CastToLong_" data-uid="GrapeCity.CalcEngine.IEvaluationContext.CastToLong*"></a>
<h4 id="GrapeCity_CalcEngine_IEvaluationContext_CastToLong_System_Double_" data-uid="GrapeCity.CalcEngine.IEvaluationContext.CastToLong(System.Double)">CastToLong(double)</h4>
<div class="markdown level1 summary"><p>Casts the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a> value to <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a> value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">long CastToLong(double value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function CastToLong(value As Double) As Long</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a> value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></td>
      <td><p>The corresponding <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a> value. <a class="xref" href="GrapeCity.CalcEngine.IEvaluationContext.Error.html#GrapeCity_CalcEngine_IEvaluationContext_Error">Error</a> will be set to <a class="xref" href="GrapeCity.CalcEngine.CalcError.html#GrapeCity_CalcEngine_CalcError_Number">Number</a> if the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a> value cannot be casted.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
