Created
December 4, 2017 02:55
-
-
Save tw-Frey/7eb21b103e2d23573f0a628bfac15875 to your computer and use it in GitHub Desktop.
自己習慣的 versionName 格式
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| versionName String.format("%.0f.%d", versionCode / 16 + 0.49, (versionCode + 15) % 16) | |
| 在 String.format 的 %.0f 會把 1.5 四捨五入 為 2.0 | |
| (但 17/16+0.4 轉 %.0f 還是 1 ?!) | |
| P.S. 17/16 = 1.0625 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment