Skip to main content

Limit Decimal Places from Length Task

Comments

5 comments

  • Permanently deleted user

    Hi Walter

    you could use String.Format in an Alert Activity   http://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx

    ie   String.Format("{0:#.##}",double1)

    where double1 is the number variable your are having trouble with 

    or Math.Round Method (Decimal, Int32)  http://msdn.microsoft.com/en-us/library/zy06z30k(v=vs.110).aspx

    depending whether you want a string or a number

    Regards

    Ralph

     

    0
  • Permanently deleted user

    Thanks very much Ralph

    You're always a great help.

    Walter

    0
  • Permanently deleted user

    Ralph,

    When I used your suggested string.Format("{0:#.##}",listofLengths) for my varaible called "listofLengths" which is a List<Double>,

    /customer/servlet/servlet.FileDownload?file=00P6000000em16EEAQ

    the result above is what I get. If I just use the listOfLengths().ToString I get values such as

    35.381011345555

    Not having any luck with formatting this List<Double> variable

    Walter

     

    0
  • Permanently deleted user

    Got It......

    listOfLengths(0).ToString("###.###") + " metres"

    Walter

     

    0
  • Permanently deleted user

    Hi Walter

    top marks for persistence  ;-)

    regards

    Ralph

    0

Please sign in to leave a comment.