Forum Discussion

RebeccaLutz's avatar
RebeccaLutz
Qrew Trainee
6 years ago

Scientific Notation

I have many fields that contain data that needs to be displayed in scientific notation.  Is there a way to display numbers this way?
  • In case anyone was interested in updates to a 6 year old post, I just discovered that Quickbase can interpret scientific notation within the ToNumber() function now. Using Dan's solution below as an example:

    var number base = ToNumber(Left([input],"^")); var number zeroes = ToNumber(Right([input],"^")); $base*(10^$zeroes)

    Simplifies to:

    var number conversion = ToNumber([input]); $conversion

  • 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.
  • 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.
  • I will take a shot at  formula when i get a chance unless someone beats me to it.
  • Try this:
    var number base   = ToNumber(Left([input],"^"));  var number zeroes = ToNumber(Right([input],"^"));  $base*(10^$zeroes)
  • 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 .

  • 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.
  • 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)
  • 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".
  • 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?