示例#1
0
        public void TestRound()
        {
            using (CultureHelper.SetCulture("en-GB"))
            {
                Helper.AssertTemplateResult("1.235", "{{ 1.234678 | round:3 }}");
                Helper.AssertTemplateResult("1", "{{ 1 | round }}");

                Assert.Null(StandardFilters.Round("1.2345678", "two"));
            }
        }
示例#2
0
        public async Task TestRound()
        {
            using (CultureHelper.SetCulture("en-GB"))
            {
                await Helper.AssertTemplateResultAsync("1.235", "{{ 1.234678 | round:3 }}");

                await Helper.AssertTemplateResultAsync("1", "{{ 1 | round }}");

                Assert.Null(StandardFilters.Round("1.2345678", "two"));
            }
        }