1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Why no TYPE_NUM or TYPE_UNUM in DataWriter?

Discussion in 'XenForo Development Discussions' started by digitalpoint, Nov 21, 2011.

  1. digitalpoint

    digitalpoint Well-Known Member

    Am I missing something, or is there no simple way to write a decimal number via the datawriter?

    Should I just pretend it's a string (although seems kind of silly to do it that way)?

    Edit - Nevermind, just noticed the TYPE_FLOAT...
    Marcus likes this.
  2. Beanjam

    Beanjam Active Member

    A bit of a thread mine, but I'm adding a decimal field and had the same question.

    As an example, xf_user_upgrade.cost_amount is a DECIMAL (10,2) defined as TYPE_FLOAT and filtered with XenForo_Input::UNUM.

    So I assume this is still the recommended way, unless anyone knows otherwise?
  3. Chris D

    Chris D XenForo Developer Staff Member

    That's still the recommended away (and in XF2, too).
    Beanjam likes this.

Share This Page