소스 검색

integer added to documentation

groucho86 1 년 전
부모
커밋
aa533633c4
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      website/more_documentation/number_documentation.py

+ 7 - 0
website/more_documentation/number_documentation.py

@@ -17,3 +17,10 @@ def more() -> None:
     def clearable():
         i = ui.number(value=42).props('clearable')
         ui.label().bind_text_from(i, 'value')
+
+    @text_demo('Integer', '''
+       Coerce the returned value to be integer instead of the default float.    
+    ''')
+    def integer():
+        i = ui.number(value=38)
+        ui.button('Check number type', on_click=lambda: ui.notify(f'{i.value=} is of type {type(i.value)}'))