[WordPress] 外掛分享: Random Numbers Generator

首頁外掛目錄 › Random Numbers Generator
WordPress 外掛 Random Numbers Generator 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
100+
安裝啟用
尚無評分
2261 天前
最後更新
問題解決
WordPress 5.0.0+ PHP 7.1+ v1.0 上架:2020-01-07

內容簡介

這個外掛可以讓你顯示預先格式化的隨機數字,以供測試或演示

屬性:
range:兩個由逗號分隔的數字。輸出將包含一個最小值和最大值之間的數字。
format:任何包含 # 字符的字符串。# 字符是生成的數字的佔位符。如果 # 後跟著一位數的整數,則該數字將按其指定的小數位數格式化。默認情況下,輸出將僅為該數字。在格式聲明中指定的任何其他字符串都將顯示為本身。
use:註冊名。當指定“use”時,第一個隨機數將被註冊以供重複使用。

示例:
[rann range=1,100]:輸出介於1和100之間的整數。
[rann range=0.25,2.5 format=#2]:輸出介於0.25和2.50之間的浮點數。
[rann range=-100,100 format=$#]:輸出在-100和100之間的帶符號整數,前面帶有美元符號。
[rann range=1,10 use=mytoken format=$#.95]:輸出在1和10之間的整數,前面帶有美元符號,後面跟著“.95”;將結果註冊以供以後使用。
[rann use=mytoken]:輸出在前一個示例中註冊的原始整數。

捐贈

不需要。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Random Numbers Generator」→ 直接安裝(推薦)

原文外掛簡介

This plugin allows you to display pre-formatted random numbers for testing or demonstration purposes.
Attributes:
range: Two numbers separated by a comma. The output will contain a number between the mininum and maximum value, in that order.
format: Any string containing at least the # character. The # character is a placeholder for the generated number. If a single digit integer follows the #, the number will be formatted with the amount of decimals it specifies. By default, the output will be the nubmer by itself. Any other string specified in the format declaration will be echoed as is.
use: The name of a register. When “use” is specified, the first instance of the random number will be registered for reuse.
Examples:
[rann range=1,100]: Outputs a integer between 1 and 100.
[rann range=0.25,2.5 format=#2]: Outputs a float between 0.25 and 2.50
[rann range=-100,100 format=$#]: Outputs a signed integer between -100 and 100, preceded by the dollar sign.
[rann range=1,10 use=mytoken format=$#.95]: Outputs an integer between 1 and 10 preceded by a dollar sign and followed by “.95”; registers the result for later use.
[rann use=mytoken]: Outputs the raw integer registered in the previous example.
Donations
None needed.

延伸相關外掛

文章
Filter
Mastodon