Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • smercer 39 posts 67 karma points
    Nov 04, 2009 @ 17:20
    smercer
    0

    Is there Database datatype for Decimal values?

    I am planning to build a product catalog, and one of the properties of my Product document type is going to be "Price".

    As one would expect, "Price" needs to be a decimal value with a precision of 2. For example, "129.99".

    I have noticed that the numeric data type only seems to accomodate int.

    Has anybody managed to find a way around this obstacle?

  • dandrayne 1138 posts 2262 karma points
    Nov 04, 2009 @ 17:38
    dandrayne
    1

    Hmm, what about using a textstring with validation like http://regexlib.com/REDetails.aspx?regexp_id=411 ?

    Not perfect, but close.

    Dan

     

  • smercer 39 posts 67 karma points
    Nov 05, 2009 @ 21:21
    smercer
    0

    It's a little "loose" for my tastes, but if that's the best we have, it will work.

  • Arpicheck 27 posts 77 karma points
    Mar 24, 2010 @ 21:44
    Arpicheck
    0

    Until now, I thought, I missed something. It's simply impossible, that Umbraco can't handle decimals. I can build up tagging, and much more out of the box, but I can't save a decimal number. Even the database storage type seems to be missing.

    Guys, is this true, or am I totally wrong?

    Of course, I could store my numbers in text fields, and yes, I know XML is about text, but please...

     

    Smercer, did you solve this "issue"?

  • Casey Neehouse 1339 posts 483 karma points MVP 2x admin
    Mar 25, 2010 @ 17:28
    Casey Neehouse
    0

    you are right.  The only option is what Dan suggests.

    In terms of it being loose, the data is rendered from xml, in which case it is treated as text.  You would still need to provide your own formatting and such.

    In such case, the only value is database space requirements for the different types.

Please Sign in or register to post replies

Write your reply to:

Draft