HowieHz 需要一个取随机数的功能,https://www.thymeleaf.org/doc/tutorials/3.1/usingthymeleaf.html 只看到了个 ${#strings.randomAlphanumeric(count)} 用来取 count 长度的随机字符串
HowieHz 搞定了 以下随机 1-100 <p id="randomSentence" th:text="${T(java.lang.Math).random() * 100 + 1}"></p> 在上面的基础上取整 <p id="randomSentence" th:text="${T(java.lang.Math).floor(T(java.lang.Math).random() * 100) + 1}"></p>
HowieHz https://howiehz.top/archives/thymeleaf-generate-format-random-number 写了篇文章,把小数也加上了,更详细完整一点,需要的可以看看