Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string.format extension should output scientific notation consistent with CEL spec #1100

Open
1 of 4 tasks
zeitgeist87 opened this issue Jan 8, 2025 · 1 comment
Open
1 of 4 tasks

Comments

@zeitgeist87
Copy link
Contributor

Describe the bug
The string.format extension currently outputs scientific notation rendered using a unicode multiplication sign × and superscript for the exponent 2.718280 × 10⁰⁰.

To Reproduce
Check which components this affects:

  • parser
  • checker
  • interpreter
  • string.format extension

Sample expression and input that reproduces the issue:

"%e".format([2.71828])

Test setup:
Existing test case.

Expected behavior
The output should instead be conforming to the CEL spec: 2.718280E+00 or 2.718280e+00

FLOAT_LIT      ::= -? DIGIT* . DIGIT+ EXPONENT? | -? DIGIT+ EXPONENT
DIGIT          ::= [0-9]
HEXDIGIT       ::= [0-9abcdefABCDEF]
EXPONENT       ::= [eE] [+-]? DIGIT+
@TristonianJones
Copy link
Collaborator

It turns out there were two issues:

It appears that both issues will be addressed, but the scope of this bug will be to temporarily strip narrow spaces on exponents until Golang updates to support the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants