Scientific Notation

  • 0
  • 1
  • Question
  • Updated 4 weeks ago
  • In Progress
I have many fields that contain data that needs to be displayed in scientific notation.  Is there a way to display numbers this way?
Photo of Rebecca Lutz

Rebecca Lutz

  • 100 Points 100 badge 2x thumb

Posted 4 weeks ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,814 Points 50k badge 2x thumb
I do not have a formula for this but be aware that Quick Base only has numerical accuracy up to 13 digits, so if you are looking to enter numbers which very high number of digits, there may need to be some planning involved, and it may depend on if you need to use them in numerical calculations.

For example you can have a text string with essentially unlimited number of digits and have a formula to display in Scientific Notation, but they would not be able to be used in arithmetic calculations.
Photo of Rebecca Lutz

Rebecca Lutz

  • 100 Points 100 badge 2x thumb
My application is recording the number of cells that are counted under the microscope, so commonly we see 1.35e6 or 1.35^6 in our documentation.  Right now, these same fields would be 1350000.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,814 Points 50k badge 2x thumb
I will take a shot at  formula when i get a chance unless someone beats me to it.
Photo of Dan

Dan

  • 1,558 Points 1k badge 2x thumb
Try this:
var number base   = ToNumber(Left([input],"^"));
var number zeroes = ToNumber(Right([input],"^"));
$base*(10^$zeroes)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,814 Points 50k badge 2x thumb
Elegant formula.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,814 Points 50k badge 2x thumb
I think that Rebecca wants to input as 1,350,000 and have another formula text field to display the Scientific Notation of 1.35^6 .

Photo of Rebecca Lutz

Rebecca Lutz

  • 100 Points 100 badge 2x thumb
Yes, we will enter 1350000 into the field and I would like it to show up as 1.35^6 in both the field and on reports.
Photo of Dan

Dan

  • 1,558 Points 1k badge 2x thumb
Try this:
var number leng = Length(ToText([numeric input]));
var number base = ToNumber(Left(ToText([numeric input]),1) & "." & NotLeft(ToText([numeric input]),1));
Left(ToText($base),".") & "." & Right(ToText($base),".") & "^" & ToText($leng-1)
Photo of Rebecca Lutz

Rebecca Lutz

  • 100 Points 100 badge 2x thumb
I am really new at Quick Base so please bear with me. 
 In fields where there is already a formula, I am getting an error that says "There are extra characters beyond the end of the formula." 
In fields where there will just be straight data input (I converted it from numeric to formula numeric), I get an error that says "Field [numeric input]) is not identified".
Photo of Dan

Dan

  • 1,558 Points 1k badge 2x thumb
You would have two fields--a numeric input field, and a text formula field. You'll enter your value (e.g., "1350000") into the numeric input field, and the text formula field will show the formatted result (e.g., "1.35^6").

In the formula I posted, the "[numeric input]" would reflect the name of your input field.

Does that make sense?