I have a datapage where I'm pulling some very large and/or very small values from SQL and displaying them on the page. When I tried pulling them as number values it would give me the values as displayed in the table (eg 0.000000001). I wanted them in exponent form, and found that when I cast the returned value as varchar it would come back in the desired format (eg 1e-09). This is for a science based application, so I don't want the e being construed as euler's number. I was wondering if there was any way to change the way the exponent is displayed, capital E or 10^-09 or something similar.
There's some logic at the front of my code such that if we have no records, return nothing; and if there are records but no chemical values, return NA. This is the code I'm using:
CASE
WHEN (SELECT Count(ReferenceID) FROM tblChemicalValues WHERE ChemicalID=target.[@field:tblChemicalValues_1_1_1_ChemicalID] AND ChemValueTypeID=12 AND PublicationID=[@field:tblChemicalValues_1_1_1_PublicationID])=0
THEN ''
WHEN (SELECT Count(ChemValue) FROM tblChemicalValues WHERE ChemicalID=target.[@field:tblChemicalValues_1_1_1_ChemicalID] AND ChemValueTypeID=12 AND PublicationID=[@field:tblChemicalValues_1_1_1_PublicationID])=0
THEN 'NA'
ELSE Cast((SELECT Max(ChemValue) FROM tblChemicalValues WHERE ChemicalID=target.[@field:tblChemicalValues_1_1_1_ChemicalID] AND ChemValueTypeID=12 AND PublicationID=[@field:tblChemicalValues_1_1_1_PublicationID]) AS VARCHAR)END
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
SciJames
Hi all,
I have a datapage where I'm pulling some very large and/or very small values from SQL and displaying them on the page. When I tried pulling them as number values it would give me the values as displayed in the table (eg 0.000000001). I wanted them in exponent form, and found that when I cast the returned value as varchar it would come back in the desired format (eg 1e-09). This is for a science based application, so I don't want the e being construed as euler's number. I was wondering if there was any way to change the way the exponent is displayed, capital E or 10^-09 or something similar.
There's some logic at the front of my code such that if we have no records, return nothing; and if there are records but no chemical values, return NA. This is the code I'm using:
The frontend looks like this:
1.7e-006
Thanks!
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.