Skip to content

CustomFormatCode - Backslash to escape special format characters #42

Description

@SebZar

Hi,
when creating a custom format, there is a problem with the escaped characters.

Also take a look at the count attribute of numFmts. Its 3 and not 2, as expected.

`
style.CurrentNumberFormat.CustomFormatCode = "yyyy-mm-dd HH:mm:ss";

style.CurrentNumberFormat.CustomFormatCode = @"#,##0\ \s";
`

style.xml result:

...
<numFmts count="3">
	<numFmt formatCode="yyyy-mm-dd HH:mm:ss" numFmtId="164"/>
	<numFmt formatCode="#,##0\\ \\s" numFmtId="165"/>
</numFmts>
...

style.xml corrected with Microsoft Excel:

...
<numFmts count="2">
	<numFmt numFmtId="164" formatCode="yyyy\-mm\-dd\ hh:mm:ss"/>
	<numFmt numFmtId="166" formatCode="#,##0\ \s"/>
</numFmts>
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions