Graphics

 View Only
  • 1.  Data Linq Cutting off zero decimal points

    Posted 07-06-2013 07:10
    Hey All,

    Building a datalinq leaderboard from an excel spreadsheet. I need to be able to display scores with 3 decimal points, which works fine until I have a .000. For some reason, Xpression is choosing to filter out zeros.

    For instance, my excel spreadsheet says 23.000, Xpression display 23. I'd like it to stay consistent for the look of the leaderboard.

    Is there a setting somewhere?


  • 2.  RE: Data Linq Cutting off zero decimal points

    Posted 07-06-2013 10:05
    Are you sure that excel has "23.000" and that is not only the display on cell ?

    Look my picture (in France, dot is replaced by a comma for decimal)... The cell has "23.000" but Excel understand that is an integer "23".



    #XPression


  • 3.  RE: Data Linq Cutting off zero decimal points

    Posted 07-06-2013 16:43
    Well, having not used an expression yet (will get my hands on one soon) but VB.Net will do that for you. You will just need to read the field and write to the field. I looked for a document on how to read a field and write back but didn't find one but I assume you would know that.

    Dim value As String

    value = Convert.ToDouble("0" + value).ToString("0.000")

    Value is the string being passed. I added the "0". This is a safety so even if you read a blank field it will return 0.000

    #XPression


  • 4.  RE: Data Linq Cutting off zero decimal points

    Posted 07-06-2013 16:47
    Oops forgot to add something

    Dim value As String

    value = "23"

    value = Convert.ToDouble("0"³ + value).ToString("0.000"³)

    I set the value as a constant but this is where you would read the field.

    The output of the value would be 23.000

    #XPression