format number properly

This commit is contained in:
Jean-Marie Mineau 2025-06-24 12:19:00 +02:00
parent 1dc9e8227e
commit d730d1f4a7
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
15 changed files with 67 additions and 29 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
main.pdf

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": todo
#import "../lib.typ": todo
= Acknowledgements

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": todo
#import "../lib.typ": todo
= Résumé en Français

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": etal
#import "../lib.typ": etal
#import "X_var.typ": *
== Introduction

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": etal, eg, ie
#import "../lib.typ": etal, eg, ie
#import "X_var.typ": *
== Related Work <sec:rasta-soa>

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": todo, etal, eg
#import "../lib.typ": todo, etal, eg
#import "X_var.typ": *
#import "X_lib.typ": *
@ -85,7 +85,7 @@ We manually searched the tool repository when the website mentioned in the paper
- the source code of the tool;
- the documentation for building and using the tool with a MWE (Minimum Working Example).
In @tab:rasta-tools we rated the quality of these artifacts with "#ok" when available but may have inconsistencies, a "#bad" when too much inconsistencies (inaccurate remarks about the sources, dead links or missing parts) have been found, a "#ko" when no documentation have been found, and a double "#ok#ok" for the documentation when it covers all our expectations (building process, usage, MWE).
In @tab:rasta-tools we rated the quality of these artifacts with "#ok" when available but may have inconsistencies, a "#bad" when too much inconsistencies (inaccurate remarks about the sources, dead links or missing parts) have been found, a "#ko" when no documentation have been found, and a double "#okk" for the documentation when it covers all our expectations (building process, usage, MWE).
Results show that documentation is often missing or very poor (#eg Lotrack), which makes the rebuild process very complex and the first analysis of a MWE.

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": todo, highlight
#import "../lib.typ": todo, highlight, num
#import "X_var.typ": *
#import "X_lib.typ": *
@ -50,8 +50,9 @@ is #mypercent(54.9, 100). When including the two defective tools, this ratio dr
#highlight()[
*RQ1 answer:*
On a recent dataset we consider that \resultunusable of the tools
are unusable. For the tools that we could run, \resultratio of analysis are finishing successfully.%(those with less than 50\% of successful execution and including the two tools that we were unable to build).
On a recent dataset we consider that \resultunusable of the tools are unusable.
For the tools that we could run, \resultratio of analysis are finishing successfully.
//(those with less than 50\% of successful execution and including the two tools that we were unable to build).
]
/*

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": todo, etal
#import "../lib.typ": todo, etal
#import "X_var.typ": *
#import "X_lib.typ": *

View file

@ -1,8 +1,3 @@
#let mypercent(numerator, denominator, digits: 2) = {
[#calc.round((100 * numerator) / denominator, digits: digits) %]
}
#let ok = text(fill: olive, sym.checkmark)
#let okk = text(fill: olive, tracking: -5pt, sym.checkmark+sym.checkmark)
@ -25,5 +20,3 @@
s
}
}
#let num(n) = [#n]

View file

@ -1,7 +1,7 @@
#import "X_lib.typ": mypercent
#import "../lib.typ": num, mypercent
#let NBTOTAL = 62525
#let NBTOTALSTRING = NBTOTAL //\num{62525}\xspace}
#let NBTOTALSTRING = num(NBTOTAL)
#let nbtools = 26
#let nbtoolsselected = 20

View file

@ -1,10 +1,8 @@
#import "@local/template-thesis-matisse:0.0.1": todo
#import "../lib.typ": todo
= RASTA
#todo[typstify RASTA paper]
#todo[Format numbers]
#todo[Bring back element from previous version of rasta]
#include("0_intro.typ")
#include("1_related_work.typ")

12
4_class_loader/main.typ Normal file
View file

@ -0,0 +1,12 @@
#import "../lib.typ": todo
= Class loaders in the middle: confusing Android static analyzers
/*
#include("0_intro.typ")
#include("1_related_work.typ")
#include("2_methodology.typ")
#include("3_experiments.typ")
#include("4_discussion.typ")
#include("5_conclusion.typ")
*/

36
lib.typ Normal file
View file

@ -0,0 +1,36 @@
#import "@local/template-thesis-matisse:0.0.1": *
// Format number.
// Following https://www.mit.edu/course/21/21.guide/numbers.htm
#let num(n, decimal: ".", thousands: " ") = {
let n = if type(n) == str {
float(n)
} else {
n
}
assert(type(n) == int or type(n) == float, message: "must be a number")
let parts = str(n).split(".")
let decimal_p = if parts.len() == 2 { parts.at(1) }
let integer_p = parts.at(0)
let integer_p = if integer_p.len() <= 4 {
integer_p
} else {
let nb_cluster = calc.div-euclid(integer_p.len(), 3)
let first_cluster_size = calc.rem-euclid(integer_p.len(), 3)
let clusters = ()
if first_cluster_size != 0 {
clusters.push(integer_p.slice(0, count: first_cluster_size))
}
for i in range(0, nb_cluster) {
clusters.push(integer_p.slice(first_cluster_size + i*3, count: 3))
}
clusters.join(thousands)
}
let formated = integer_p + if decimal_p != none { decimal + decimal_p }
[#formated]
}
#let mypercent(numerator, denominator, digits: 2) = [#num(calc.round((100 * numerator) / denominator, digits: digits))%]

BIN
main.pdf

Binary file not shown.

View file

@ -1,4 +1,4 @@
#import "@local/template-thesis-matisse:0.0.1": *
#import "lib.typ": *
#import "jury.typ": jury-content
#import "abstract.typ": keywords-en, keywords-fr, abstract-en, abstract-fr
@ -115,11 +115,8 @@
) <alg:hello-void>
#include("3_rasta/rasta.typ")
= Contribution 2
#lorem(500)
#include("3_rasta/main.typ")
#include("4_class_loader/main.typ")
= Contribution n