Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,326

    [firebird] arrotondamento numero

    ciao a tutti,

    qualcuno mi sa spiegare come fare l'arrotondamento?

    eseguento questa query ottengo valori diversi:
    premesso che 115/60 = 1.916

    select
    cast(1.916 as integer),
    cast((115/60) as integer),
    round(1.916,0),
    round((115/60),0)
    FROM RDB$DATABASE

    cast(1.916 as integer) = 2
    cast((115/60) as integer) = 1
    round(1.916,0) = 2
    round((115/60),0) = 1

    mi dite cosa sbaglio?

    grazie

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,326
    avrei trovata questa soluzione:

    round(cast(115 as numeric(15,6)) /60) = 2

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.