microsoft / microsoft/Power-Fx

Review Text format decisions

Open
#1,773 0 comments 0 reactions 1 assignee View on GitHub

@gregli-msft is already working on this.

Since Aug 18, 2023.

Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Description

We made a few decisions that deviated from Excel in cases where we think they have a bug. This issue to review these with a broader group.

>> Text(70.82430555555555555555555,"h:mm:ss A/P")
"7:47:00 P"

>> Text(70.82430555555555555555555,"h:mm:ss a/p")
"7:47:00 p"

>> Text(70.82430555555555555555555,"h:mm:ss AM/PM")
"7:47:00 PM"

>> Text(70.82430555555555555555555,"h:mm:ss am/pm")
"7:47:00 pm"

// C# supports E without a '+' or '-' after it.  Consitent with Excel, we do not.
>> Text(1234567.123,"0.00E+")
Error

>> Text(1234567.123,"0.00E")
Error

>> Text(1234567.123,"0.00e+")
Error

>> Text(1234567.123,"0.00e")
Error

>> Text( 1234567.1234567, "e" )
Errors: Error 0-28: The function 'Text' has some invalid arguments.|Warning 23-26: Incorrect format specifier for 'Text'.

// Excel: "0123.46E+04"
>> Text( 1234567.1234567, "0000.00E+00" )
"1234.57E+03"

// Excel: "123.46E+04"
>> Text( 1234567.1234567, "####.00E+00" )
"1234.57E+03"

// Oddball case from Excel, returns "Z5280ro", which appears to be undocumented behavior.  
// We don't interpret the 'e'.  
>> Text( 1234567.1234567, "Zero" )
"Zero"

// Colon, interpreted as a time seperator, not allowed between numbers, REVIEW
// Excel: ":"
>> Text( 2, ":" )
":"

// Excel: ":"
>> Text( 2, "::" )
"::"

// Excel: ":"
>> Text( 2, ":::" )
":::"

// Text of Blank, without a format, is blank.  Text of Blank, with a format, is empty string.
>> Text( If(1<0,1,Blank()) )
Blank()

>> Text( If(1<0,1,Blank()), "####" )
""

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.