Class LegacyCFormat

java.lang.Object
freemarker.core.CFormat
freemarker.core.LegacyCFormat

public final class LegacyCFormat extends CFormat
Corresponds to the behavior of ?c before 2.3.32 (when there were no CFormat-s yet). This only exists for strict backward-compatibility, otherwise avoid this, mostly because its number-to-string conversion sometimes do rounding, and infinity and NaN formatting has some glitches. This is the default of c_format if incompatible_improvements is less than 2.3.32.

If incompatible_improvements is at least 2.3.21, then infinity is formatted as INF, and NaN as NaN. If it's less, then infinity is formatted to the infinity character (U+221E), and NaN to the UNICODE replacement character (U+FFFD). But, because of an old bug that we emulate, this only applies to the behavior of ?c/?cn, and not to the "c" and "computer" number_format. The last uses the pre-2.3.21 format before incompatible_improvements 2.3.31.

Experimental class! This class is too new, and might will change over time. Therefore, for now constructor and most methods are not exposed outside FreeMarker, and so you can't create a custom implementation. The class itself and some members are exposed as they are needed for configuring FreeMarker.

Since:
2.3.32
See Also:
JavaScriptOrJSONCFormat