Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mincss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
mincss
Commits
bed50c9b
Commit
bed50c9b
authored
10 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Minified numbers are now rounded to 2 decimal digits
parent
bcf78917
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stringify.ml
+5
-2
5 additions, 2 deletions
stringify.ml
with
5 additions
and
2 deletions
stringify.ml
+
5
−
2
View file @
bed50c9b
...
...
@@ -147,13 +147,16 @@ let string_of_stylesheet = cat "\n\n" string_of_statement
*)
let
minify_num
n
=
(* Round numbers to at most 2 decimal digits *)
let
round2
n
=
floor
(
100
.
*.
n
+.
0
.
5
)
/.
100
.
in
if
float_of_int
(
int_of_float
n
)
=
n
then
string_of_int
(
int_of_float
n
)
else
if
n
<
1
.
0
&&
n
>
-
1
.
0
then
let
s
=
string_of_float
n
in
let
s
=
string_of_float
(
round2
n
)
in
String
.
sub
s
1
(
String
.
length
s
-
1
)
else
string_of_float
n
string_of_float
(
round2
n
)
let
rec
minify_expr
=
function
|
Concat
values
->
cat
" "
minify_expr
values
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment