Results 1 to 2 of 2

Thread: How to remove last two number ending after float point SQL server 2008?

  1. #1
    Join Date
    Jul 2017
    Posts
    3

    How to remove last two number ending after float point SQL server 2008?

    I work on SQL server 2008 and I need to remove Last Two digit After Float Point

    table already have big data and this is sample as below

    max number after float point is 6 and at least one number after float point

    if i have one digit After Float Point nothing do

    So How to do that ?

    Code:
    create table #temp
    (
    Numbers float
    )
    insert into #temp(Numbers)
    values
    (155.7865),
    (708.986517),
    (200.333),
    (555.3)
    
    select * from #temp

    Expected Result


    Code:
    Numbers
    155.78
    708.9865
    200.3
    555.3

    What I have tried:


    select round(Numbers,2),* from #temp

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,926
    Try using CONVERT function with LENGTH parameter

Tags for this Thread

Posting Permissions

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