LegacyCFormat (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.core, class: LegacyCFormat

Package freemarker.core

# 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`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static LegacyCFormat`
  `INSTANCE`
  `static String`
  `NAME`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### INSTANCE

    public static final LegacyCFormat INSTANCE

  - ### NAME

    public static final String NAME
    See Also:
      Constant Field Values

- ## Method Details

  - ### getName

    public String getName()
    Specified by:
      `getName` in class `CFormat`