How to convert scientific notation to numeric types in VMware Tanzu Greenplum
search cancel

How to convert scientific notation to numeric types in VMware Tanzu Greenplum

book

Article ID: 296638

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

This article explains how to convert scientific notation to numeric types in VMware Tanzu Greenplum.

Environment

Product Version: 6.12

Resolution

To convert scientific notation to numeric types, follow the examples below:
test=# select CAST(CAST('10e+003'  AS FLOAT) AS int);   
 int4  
-------
 10000
(1 row)
 
test=# select CAST(CAST('10e+003'  AS FLOAT) AS bigint); 
 int8  
-------
 10000
(1 row)