Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 25 Feb 2011 @ 14:25:29 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Decimal display problem
 
From:   Singh, Sudhansu

The expression with in the cast is integral meaning involves integers result will also have a integer.

One of the operational value should be decimal. Below is the demonstration:

     sel cast((100/3) as decimal(6,3));
     33.000

     sel cast((100.0/3) as decimal(6,3));
     33.300

     sel cast((100.00/3) as decimal(6,3));
     33.330

     sel cast((100.000/3) as decimal(6,3));
     33.333

     sel cast((100.0000/3) as decimal(6,3));
     33.333

     sel cast((cast(100 as decimal(6,3))/3) as decimal(6,3));
     33.333

regards,

Sudhansu



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023