docs: establish marqdo-lint architecture and examples
This commit is contained in:
1 parent
326c9bb119
commit
68b14db095
19 files changed
+1338
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<meta charset="utf-8">
|
||||
<title>Marqdo Lint Review Fixture</title>
|
||||
<body>
|
||||
<h1>@knowledge 定价示例</h1>
|
||||
<h2>@exec 计算会员价格</h2>
|
||||
<p>根据用户的会员身份计算最终支付金额。会员享受九折优惠,
|
||||
非会员维持原价。采用整数运算,避免金额处理中的浮点误差。</p>
|
||||
<p><code>params(原价: Int, 是否会员: Bool)</code></p>
|
||||
<ol>
|
||||
<li>
|
||||
<p><code>if 是否会员</code>:会员享受九折优惠。</p>
|
||||
<p>为保持金额计算的确定性,先乘以九,再进行整数除法。</p>
|
||||
<p><strong>最终价格 = 原价 * 9 // 10</strong></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>else</code>:其余用户保留原价。</p>
|
||||
<p><strong>最终价格 = 原价</strong></p>
|
||||
</li>
|
||||
</ol>
|
||||
<p><code>end</code></p>
|
||||
<p>计算结束后返回以最小货币单位表示的最终应付金额。</p>
|
||||
<p><em>return 最终价格</em></p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user