Trimming decimal precision

Results 1 to 2 of 2

Thread: Trimming decimal precision

  1. #1
    Join Date
    Dec 1969

    Default Trimming decimal precision

    I&#039m pulling some data from an SQL database.<BR>Some of the numbers are coming back as<BR>8.3478939. I would like to only show one<BR>decimal place of precision. The number to <BR>the left of the decimal could be up to 3<BR>characters long. Is there a way in ASP to <BR>use start at a specific character and trim<BR>after x number of spaces? Start at the<BR>decimal and only show one place, trimming<BR>everything after for display only.

  2. #2
    Join Date
    Dec 1969

    Default RE: Trimming decimal precision

    To show one decimal place, use:<BR><BR> int(x * 10) / 10<BR><BR>To show two decimal places, use:<BR><BR> int(x * 100) / 100<BR><BR>etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts