2014-09-12 70 views
0

「浮動」,增加了箭頭添加「臺階」,我覺得這惱人,因爲它增加了0.00000001在contenttype.yml中,字段類型是用來存儲貨幣的嗎?

<input class="form-control narrow" name="cash" id="cash" step="0.00000001" value="0" type="number"> 

,因爲它們是「臺階」小,好,我明白,這是錯誤的存儲錢雙(浮動存儲爲雙精度)並且應該是小數,但「數字」現在在Bolt中已棄用。

什麼是正確的方法?

# possible field types in bolt: 
# text - varchar(256) - input type text. 
# integer - integer - Input field for integer numbers. 
# float - double - Input field for floating numbers, stored as 'Double'. 
# geolocation - text (65kb) - Input field for geolocation. Enter an address, and the location is geocoded to latitude/longitude coordinates 
# imagelist - text (65kb) - Input type for imagelists. Add multiple images with a description. Useful for image sliders, galleries, etcetera. 
# image - varchar(256) - image select/upload widget, stored as filename. 
# file - varchar(256) - file select/upload widget, stored as filename. 
# filelist - text (65kb) - Input type for a list of files. Including a description. 
# video - varchar(256) - Video embed widget, stored as filename. 
# html - text (65kb) - wysiwyg element. 
# textarea - varchar(32768) - Simple, plain <textarea> field. 
# markdown - varchar(32768) - Simple, plain <textarea> field, which is parsed as Markdown text. 
# datetime - datetime - date and time selector widget. 
# date - datetime - date selector widget. 
# select - varchar(256) - select with predefined values 
# templateselect - varchar(256) - select with template filenames 
# checkbox - integer - checkbox-field which is 1 (checked) or 0 (unchecked) 


# number (deprecated) - input type decimal(18,9), useful for storing number that need to be sortable 

回答

相關問題