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

Add formatNumber, parseEpoch and parseTicks. #2198

Merged
merged 4 commits into from May 7, 2020
Merged

Conversation

chrimc62
Copy link
Contributor

@chrimc62 chrimc62 commented May 7, 2020

Fixes #2189

Description

Refers to the first question in microsoft/botbuilder-dotnet#3873

formatNumber(num1, num2), takes two arguments, the first one should be a numeric value, and the second one should be an integer. The returned value is a string
Examples
formatNumber(12.123, 2) = "12.12"
formatNumber(20, 2) = "20.00"
formatNumber(1.555, 2) = "1.56"
formatNumber(12.123, 4) = "12.1230"

Added formatEpoch and formatTicks.
formatEpoch(1521118800) -> 2018-03-15T13:00:00.000Z
formatTicks(637243624200000000) -> 2020-05-06T11:47:00.000Z

Removed ticks functionality from formatDateTime.

@coveralls
Copy link

coveralls commented May 7, 2020

Pull Request Test Coverage Report for Build 128992

  • 303 of 344 (88.08%) changed or added relevant lines in 2 files are covered.
  • 10 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.07%) to 80.004%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/adaptive-expressions/src/expressionFunctions.ts 296 337 87.83%
Files with Coverage Reduction New Missed Lines %
libraries/adaptive-expressions/src/expressionFunctions.ts 1 89.25%
libraries/botframework-streaming/src/webSocket/webSocketTransport.ts 2 80.65%
libraries/botframework-streaming/src/webSocket/webSocketServer.ts 7 66.67%
Totals Coverage Status
Change from base Build 128987: -0.07%
Covered Lines: 12650
Relevant Lines: 15087

💛 - Coveralls

@cleemullins cleemullins added the R10 Release 10 - August 17th, 2020 label May 7, 2020
@boydc2014 boydc2014 merged commit 20ce092 into master May 7, 2020
@boydc2014 boydc2014 deleted the shuwan/formatNum branch May 7, 2020 04:19
boydc2014 pushed a commit that referenced this pull request May 7, 2020
* Add formatNumber, parseEpoch and parseTicks.

* Switch to ESNext like other packages.
Switch ticks to bigInt.
Add tests.

Co-authored-by: Shuai Wang <shuwan@microsoft.com>
boydc2014 added a commit that referenced this pull request May 7, 2020
* [PORT] [Expression] Add more timex builtin functions (#2187)

* add more timex function

* fix typo

* fix typo

* Add formatNumber, parseEpoch and parseTicks. (#2198)

* Add formatNumber, parseEpoch and parseTicks.

* Switch to ESNext like other packages.
Switch ticks to bigInt.
Add tests.

Co-authored-by: Shuai Wang <shuwan@microsoft.com>

Co-authored-by: Hongyang Du (hond) <hond@microsoft.com>
Co-authored-by: Chris McConnell <chrimc@microsoft.com>
Co-authored-by: Shuai Wang <shuwan@microsoft.com>
Stevenic added a commit that referenced this pull request May 8, 2020
* Add Dialog / PageView telemetry (#2145)

* Update app insights package version

* Add PageView logging

* move TelemetryView helper to botTelemetryClient.ts

* remove telemetry Extensions class, harden helper method, add tests

Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* move botbuilder-lg and adaptive-expressions out of preview (#2190)

* move botbuilder-lg and adaptive-expressions out of preview

* correct set-version script in preview packages

* restore preview packages to using Version instead of PreviewPackageVersion

* Fixed issues with AdaptiveSkillDialog (#2196)

and added unit tests

* [Cherry-pick] timex and formatX functions (#2200)

* [PORT] [Expression] Add more timex builtin functions (#2187)

* add more timex function

* fix typo

* fix typo

* Add formatNumber, parseEpoch and parseTicks. (#2198)

* Add formatNumber, parseEpoch and parseTicks.

* Switch to ESNext like other packages.
Switch ticks to bigInt.
Add tests.

Co-authored-by: Shuai Wang <shuwan@microsoft.com>

Co-authored-by: Hongyang Du (hond) <hond@microsoft.com>
Co-authored-by: Chris McConnell <chrimc@microsoft.com>
Co-authored-by: Shuai Wang <shuwan@microsoft.com>

* Updated packages to target ES6 (#2204)

* Switch adaptive-expressions to es6 (#2205)

* Drop back to es5 and add bigint support.

* Fix test script.

* Fix test script.

* Remove adaptive.

* Remove space.

* Remove changes to package.json.

* update adaptive-expressions target to es5 for initial testing

* Push es5.

Co-authored-by: stevengum <14935595+stevengum@users.noreply.github.com>

* Renamed AdaptiveSkillDialog to BeginSkillDialog (#2212)

* Renamed BeginSkill action again (#2215)

* Renamed BeginSkill action again

* update component registration

Co-authored-by: Gary Pretty <gary@garypretty.co.uk>
Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Hongyang Du (hond) <hond@microsoft.com>
Co-authored-by: Chris McConnell <chrimc@microsoft.com>
Co-authored-by: Shuai Wang <shuwan@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R10 Release 10 - August 17th, 2020
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Expressions] Add prebuilt functions for adaptive cards team.
5 participants