Tuesday, 15 February 2011

sql - Drop 0 value in decimal places -


I want to ask if anyone knows the query to drop the value of 0 in the decimal.

for example: fields these values ​​in the name percent

percent

770.00000000000000000000, 340.670000000000000000000, 96.00000000000000000000, 4400.56000000000000000000, 109.89000000000000000000, 109.0000000000000000000000, 370000000000000000000000, 37.0000000000000000000000,

Currently I am using the query "Select ([percent] as decimal (9.2)) as the result of [percent] table" and result

G: I want to really get the result: ->

770, 340.67, 96 , 4400.56, 109.8 9, 109, 37,

You can use a combination of DECIMAL and FLOAT . To round it in two places of DCAML, select first decimal, unwanted 0

for example

  (decimal ([percent] as decimal ( 9.2)) with the example of float [percent]  

340.69999999999999, it is in the 340.70 era, so it takes zero by giving you 340.7. As anyone Some precision will be lost with the goal.


No comments:

Post a Comment