Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

HOw to display Number in Scientific Notation in version 2008


I am using Access database, and I have number field I want to display that number field in Scienfic notation

So can u gudie me how to display number in Scienfic notation in Crystal Report 2008

Thank U

Former Member
Former Member replied

Here's a quick UDF I threw together that works for positive exponents. Just add it to your Report Custom Functions.

Function (numbervar innum)

local stringvar Original;

local stringvar before ;

local stringvar after ;

local numbervar expo ;

local stringvar combo ;

local stringvar outnum;

Original := totext(innum) ;

Original := replace(Original,",","");

if instr(Original,".") > 0

then (before := left(Original,(instr(Original,".")-1)) ; after := mid(Original,instr(Original,".")+1); expo := len(before)-1)

else (before := Original ; after := '0'; expo := len(Original)-1) ;

combo := before&after ;

outnum:= left(combo,1)"."mid(combo,2)"E"totext(expo,0);

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question