【发布时间】:2014-07-17 22:38:23
【问题描述】:
我有一个T4 template,它创建了一系列从预定义数据集派生的static readonly 变量。
如果我将 double.NaN 作为构造函数参数传递,则模板输出呈现为 NaN,而不是 double.NaN,正如我所料。 p>
模板的相关部分是:
<#= double.IsNaN(element.MeltingPoint) ? double.NaN : element.MeltingPoint #>
导致编译错误:The name 'NaN' does not exist in the current context
如果我手动将代码更改为读取double.NaN,那么它编译得很好。
如何强制将输出读取为文字字符串double.NaN?
【问题讨论】:
标签: c# .net t4 template-engine