Overview

Namespaces

  • Kotchasan
    • Cache
    • Database
    • Http
    • Log
    • Orm
  • None
  • PHP
  • Psr
    • Cache
    • Http
      • Message
    • Log

Classes

  • Accordion
  • ApiController
  • ArrayTool
  • CKEditor
  • Collection
  • Config
  • Controller
  • Country
  • Csv
  • Curl
  • Currency
  • Database
  • DataTable
  • Date
  • DOMNode
  • DOMParser
  • Email
  • File
  • Files
  • Form
  • Grid
  • Html
  • Htmldoc
  • HtmlTable
  • Image
  • InputItem
  • Inputs
  • KBase
  • Language
  • ListItem
  • Login
  • Menu
  • Mime
  • Model
  • Number
  • ObjectTool
  • Password
  • Pdf
  • Province
  • Router
  • Session
  • Singleton
  • Tab
  • TableRow
  • Template
  • Text
  • Validator
  • View

Exceptions

  • ApiException
  • InputItemException
  • Overview
  • Namespace
  • Class
  • Tree

Class Number

ฟังก์ชั่นตัวเลข

Namespace: Kotchasan
Author: Goragod Wiriya admin@goragod.com
Since: 1.0
Located at Kotchasan/Number.php
Methods summary
public static string
# format( float $value, string $thousands_sep = ',' )

ฟังก์ชั่น เติม comma รองรับจุดทศนิยม ถ้าไม่มีทศนิยมคืนค่า จำนวนเต็ม ไม่ปัดเศษ

ฟังก์ชั่น เติม comma รองรับจุดทศนิยม ถ้าไม่มีทศนิยมคืนค่า จำนวนเต็ม ไม่ปัดเศษ

Parameters

$value
$thousands_sep
(optional) เครื่องหมายหลักพัน (default ,)

Returns

string

Assert

(100) [==] "100"
(100.1) [==] "100.1"
(1000.12) [==] "1,000.12"
(1000.1555) [==] "1,000.1555"
public static mixed
# division( $actual, $divisor )

หังก์ชั่นหาร $divisor เท่ากับ 0 คืนค่า 0

หังก์ชั่นหาร $divisor เท่ากับ 0 คืนค่า 0

Parameters

$actual
ตัวตั้ง
$divisor
ตัวหาร

Returns

mixed
public static string
# printf( string $format, mixed $value )

จัดรูปแบบตัวเลข รองรับการเติม วัน เดือน ปี

จัดรูปแบบตัวเลข รองรับการเติม วัน เดือน ปี

Parameters

$format
$value

Returns

string

Assert

('G%04d', 1) [==] "G0001"
('G-%Y-%m-%d-%04d', 1) [==] "G-63-08-19-0001"
('G-%y-%m-%d-%04d', 1) [==] "G-20-08-19-0001"
('G-%YYYY-%m-%d-%04d', 1) [==] "G-2563-08-19-0001"
('G-%yyyy-%m-%d-%04d', 1) [==] "G-2020-08-19-0001"
Kotchasan API documentation generated by ApiGen